Closed Bug 1580890 Opened 5 years ago Closed 5 years ago

Inline Preview: Improve performance of generateInlinePreview action

Categories

(DevTools :: Debugger, enhancement)

enhancement
Not set
normal

Tracking

(firefox71 fixed)

RESOLVED FIXED
Firefox 71
Tracking Status
firefox71 --- fixed

People

(Reporter: davidwalsh, Assigned: davidwalsh)

References

(Blocks 2 open bugs)

Details

(Whiteboard: [debugger-mvp])

Attachments

(1 file)

The generateInlinePreview action could be optimized in a few ways:

  • Bail earlier to avoid await parser.getScopes if other conditions are not met
  • Utilize validateThreadContext to bail on running async tasks with quick stepping
  • Use Promise.all instead of await'ing in succession
Assignee: nobody → dwalsh
Blocks: dbg-71
Status: NEW → ASSIGNED
Whiteboard: [debugger-mvp]
Pushed by dwalsh@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/1bed7919ff1e
Restructure inline-preview action for better performance r=jlast
Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 71

Backed out changeset 1bed7919ff1e (bug 1580890) frequently failing browser_dbg-debug-line.js (bug 1581026)

Backout link: https://hg.mozilla.org/integration/autoland/rev/6bd283a6e9bb618734e70e3ab2465ab84f1431c3

**Push with failures:**https://treeherder.mozilla.org/#/jobs?repo=autoland&searchStr=devtools&revision=1bed7919ff1e67d547894aee584d8792bfb868e7&selectedJob=266440561

Log link: https://treeherder.mozilla.org/logviewer.html#/jobs?job_id=266440561&repo=autoland&lineNumber=1017

Log snippet:
[task 2019-09-12T23:53:21.991Z] 23:53:21 INFO - TEST-START | devtools/client/webreplay/mochitest/browser_dbg_rr_breakpoints-01.js
[task 2019-09-12T23:53:22.159Z] 23:53:22 INFO - GECKO(1639) | MIDDLEMAN 1644 /var/folders/70/_p63h8417253ysc_spcrn3rh000017/T/TempRecording.1639.1
[task 2019-09-12T23:53:22.254Z] 23:53:22 INFO - GECKO(1639) | RECORDING 1645 /var/folders/70/_p63h8417253ysc_spcrn3rh000017/T/TempRecording.1639.1
[task 2019-09-12T23:53:22.887Z] 23:53:22 INFO - GECKO(1639) | JavaScript error: chrome://global/content/browser-child.js, line 26: ReferenceError: Services is not defined
[task 2019-09-12T23:53:23.556Z] 23:53:23 INFO - GECKO(1639) | [ReplayControl 0.72] ManifestFinished #0 {"point":{"checkpoint":1,"progress":1}}
[task 2019-09-12T23:53:23.556Z] 23:53:23 INFO - GECKO(1639) | [ReplayControl 0.72] SendManifest #0 {"kind":"flushRecording"}
[task 2019-09-12T23:53:23.556Z] 23:53:23 INFO - GECKO(1639) | [ReplayControl 0.72] ManifestFinished #0 undefined
[task 2019-09-12T23:53:23.593Z] 23:53:23 INFO - GECKO(1639) | REPLAYING 1647 /var/folders/70/_p63h8417253ysc_spcrn3rh000017/T/TempRecording.1639.1
[task 2019-09-12T23:53:23.803Z] 23:53:23 INFO - GECKO(1639) | REPLAYING 1648 /var/folders/70/_p63h8417253ysc_spcrn3rh000017/T/TempRecording.1639.1
[task 2019-09-12T23:53:23.997Z] 23:53:23 INFO - GECKO(1639) | REPLAYING 1649 /var/folders/70/_p63h8417253ysc_spcrn3rh000017/T/TempRecording.1639.1
[task 2019-09-12T23:53:24.137Z] 23:53:24 INFO - GECKO(1639) | ***** Fatal Record/Replay Error *****
[task 2019-09-12T23:53:24.137Z] 23:53:24 INFO - GECKO(1639) | Input Mismatch: Lock Recorded 218 Replayed 251
[task 2019-09-12T23:53:24.198Z] 23:53:24 INFO - GECKO(1639) | REPLAYING 1650 /var/folders/70/_p63h8417253ysc_spcrn3rh000017/T/TempRecording.1639.1
[task 2019-09-12T23:53:24.227Z] 23:53:24 INFO - GECKO(1639) | ***** Fatal Record/Replay Error *****
[task 2019-09-12T23:53:24.227Z] 23:53:24 INFO - GECKO(1639) | Input Mismatch: Lock Recorded 218 Replayed 147
[task 2019-09-12T23:53:24.313Z] 23:53:24 INFO - GECKO(1639) | ***** Fatal Record/Replay Error *****
[task 2019-09-12T23:53:24.313Z] 23:53:24 INFO - GECKO(1639) | Input Mismatch: Lock Recorded 218 Replayed 153
[task 2019-09-12T23:53:24.350Z] 23:53:24 INFO - GECKO(1639) | [ReplayControl 1.51] AddSavedCheckpoint #1 1
[task 2019-09-12T23:53:24.350Z] 23:53:24 INFO - GECKO(1639) | [ReplayControl 1.51] AddSavedCheckpoint #2 1
[task 2019-09-12T23:53:24.350Z] 23:53:24 INFO - GECKO(1639) | [ReplayControl 1.51] SendManifest #0 {"kind":"resume","breakpoints":[],"pauseOnDebuggerStatement":true}
[task 2019-09-12T23:53:24.350Z] 23:53:24 INFO - GECKO(1639) | [ReplayControl 1.51] Child Crashed: 1
[task 2019-09-12T23:53:24.422Z] 23:53:24 INFO - GECKO(1639) | REPLAYING 1652 /var/folders/70/_p63h8417253ysc_spcrn3rh000017/T/TempRecording.1639.1
[task 2019-09-12T23:53:24.546Z] 23:53:24 INFO - GECKO(1639) | ***** Fatal Record/Replay Error *****
[task 2019-09-12T23:53:24.546Z] 23:53:24 INFO - GECKO(1639) | Input Mismatch: Lock Recorded 218 Replayed 153
[task 2019-09-12T23:53:24.555Z] 23:53:24 INFO - GECKO(1639) | [ReplayControl 1.73] AddSavedCheckpoint #5 1
[task 2019-09-12T23:53:24.556Z] 23:53:24 INFO - GECKO(1639) | [ReplayControl 1.73] Child Crashed: 2
[task 2019-09-12T23:53:24.622Z] 23:53:24 INFO - GECKO(1639) | REPLAYING 1654 /var/folders/70/_p63h8417253ysc_spcrn3rh000017/T/TempRecording.1639.1
[task 2019-09-12T23:53:24.729Z] 23:53:24 INFO - GECKO(1639) | ***** Fatal Record/Replay Error *****
[task 2019-09-12T23:53:24.729Z] 23:53:24 INFO - GECKO(1639) | Input Mismatch: Lock Recorded 218 Replayed 242
[task 2019-09-12T23:53:24.756Z] 23:53:24 INFO - GECKO(1639) | [ReplayControl 1.92] AddSavedCheckpoint #6 1
[task 2019-09-12T23:53:24.756Z] 23:53:24 INFO - GECKO(1639) | [ReplayControl 1.92] Child Crashed: 3
[task 2019-09-12T23:53:24.826Z] 23:53:24 INFO - GECKO(1639) | REPLAYING 1656 /var/folders/70/_p63h8417253ysc_spcrn3rh000017/T/TempRecording.1639.1
[task 2019-09-12T23:53:24.896Z] 23:53:24 INFO - GECKO(1639) | ***** Fatal Record/Replay Error *****
[task 2019-09-12T23:53:24.896Z] 23:53:24 INFO - GECKO(1639) | Input Mismatch: Lock Recorded 218 Replayed 140
[task 2019-09-12T23:53:24.955Z] 23:53:24 INFO - GECKO(1639) | [ReplayControl 2.12] AddSavedCheckpoint #7 1
[task 2019-09-12T23:53:24.976Z] 23:53:24 INFO - GECKO(1639) | [ReplayControl 2.14] Child Crashed: 4
[task 2019-09-12T23:53:25.027Z] 23:53:25 INFO - GECKO(1639) | REPLAYING 1658 /var/folders/70/_p63h8417253ysc_spcrn3rh000017/T/TempRecording.1639.1
[task 2019-09-12T23:53:25.115Z] 23:53:25 INFO - GECKO(1639) | ***** Fatal Record/Replay Error *****
[task 2019-09-12T23:53:25.115Z] 23:53:25 INFO - GECKO(1639) | Input Mismatch: Lock Recorded 218 Replayed 146
[task 2019-09-12T23:53:25.205Z] 23:53:25 INFO - GECKO(1639) | [ReplayControl 2.34] AddSavedCheckpoint #8 1
[task 2019-09-12T23:53:25.205Z] 23:53:25 INFO - GECKO(1639) | [ReplayControl 2.34] Child Crashed: 5
[task 2019-09-12T23:53:25.206Z] 23:53:25 INFO - GECKO(1639) | ReplayControl Server Error: Too many crashes Stack: ThrowError@resource://devtools/server/actors/replay/control.js:2102:17
[task 2019-09-12T23:53:25.207Z] 23:53:25 INFO - GECKO(1639) | ChildCrashed@resource://devtools/server/actors/replay/control.js:1322:15
[task 2019-09-12T23:53:25.207Z] 23:53:25 INFO - GECKO(1639) | JavaScript error: resource://devtools/server/actors/replay/control.js, line 2102: Error: Too many crashes
[task 2019-09-12T23:53:25.207Z] 23:53:25 INFO - GECKO(1639) | ###!!! [Parent][RunMessage] Error: Channel error: cannot send/recv
[task 2019-09-12T23:53:48.180Z] 23:53:48 INFO - GECKO(1639) | 2019-09-12 23:53:48.163 firefox[1639:6692] Persistent UI failed to open file file:///Users/cltbld/Library/Saved%20Application%20State/org.mozilla.nightly.savedState/window_1.data: No such file or directory (2)
[task 2019-09-12T23:56:22.272Z] 23:56:22 INFO - TEST-INFO | started process screencapture
[task 2019-09-12T23:56:22.435Z] 23:56:22 INFO - TEST-INFO | screencapture: exit 0
[task 2019-09-12T23:56:22.435Z] 23:56:22 INFO - Buffered messages logged at 23:53:22
[task 2019-09-12T23:56:22.436Z] 23:56:22 INFO - Entering test bound
[task 2019-09-12T23:56:22.436Z] 23:56:22 INFO - Waiting for event: 'RecordingFinished' on [object ParentProcessMessageManager].
[task 2019-09-12T23:56:22.436Z] 23:56:22 INFO - Console message: [JavaScript Error: "ReferenceError: Services is not defined" {file: "chrome://global/content/browser-child.js" line: 26}]
[task 2019-09-12T23:56:22.436Z] 23:56:22 INFO - Buffered messages logged at 23:53:25
[task 2019-09-12T23:56:22.437Z] 23:56:22 INFO - Console message: [JavaScript Error: "remote browser crashed while on about:blank
[task 2019-09-12T23:56:22.437Z] 23:56:22 INFO - " {file: "chrome://mochikit/content/mochitest-e10s-utils.js" line: 10}]
[task 2019-09-12T23:56:22.437Z] 23:56:22 INFO - e10s_init/<@chrome://mochikit/content/mochitest-e10s-utils.js:10:10
[task 2019-09-12T23:56:22.437Z] 23:56:22 INFO - EventListener.handleEvente10s_init@chrome://mochikit/content/mochitest-e10s-utils.js:6:10
[task 2019-09-12T23:56:22.437Z] 23:56:22 INFO - testInit@chrome://mochikit/content/browser-test.js:131:5
[task 2019-09-12T23:56:22.437Z] 23:56:22 INFO - setTimeout handler
@chrome://mochikit/content/browser-test.js:41:11
[task 2019-09-12T23:56:22.437Z] 23:56:22 INFO - loadChromeScripts@jar:file:///var/folders/70/_p63h8417253ysc_spcrn3rh000017/T/tmps0j8K9.mozrunner/extensions/mochikit@mozilla.org.xpi!/api.js:21:25
[task 2019-09-12T23:56:22.437Z] 23:56:22 INFO - loadMochitest@jar:file:///var/folders/70/p63h8417253ysc_spcrn3rh000017/T/tmps0j8K9.mozrunner/extensions/mochikit@mozilla.org.xpi!/api.js:143:20
[task 2019-09-12T23:56:22.438Z] 23:56:22 INFO - @tests/mochitest/runtests.py:1810:5
[task 2019-09-12T23:56:22.438Z] 23:56:22 INFO - @tests/mochitest/runtests.py:1811:8
[task 2019-09-12T23:56:22.438Z] 23:56:22 INFO - evaluate.sandbox/promise<@chrome://marionette/content/evaluate.js:138:10
[task 2019-09-12T23:56:22.438Z] 23:56:22 INFO - evaluate.sandbox@chrome://marionette/content/evaluate.js:114:17
[task 2019-09-12T23:56:22.438Z] 23:56:22 INFO - GeckoDriver.prototype.execute
@chrome://marionette/content/driver.js:1070:28
[task 2019-09-12T23:56:22.438Z] 23:56:22 INFO - async*GeckoDriver.prototype.executeScript@chrome://marionette/content/driver.js:945:30
[task 2019-09-12T23:56:22.438Z] 23:56:22 INFO - despatch@chrome://marionette/content/server.js:305:40
[task 2019-09-12T23:56:22.438Z] 23:56:22 INFO - execute@chrome://marionette/content/server.js:275:16
[task 2019-09-12T23:56:22.438Z] 23:56:22 INFO - onPacket/<@chrome://marionette/content/server.js:248:20
[task 2019-09-12T23:56:22.438Z] 23:56:22 INFO - onPacket@chrome://marionette/content/server.js:249:9
[task 2019-09-12T23:56:22.438Z] 23:56:22 INFO - _onJSONObjectReady/<@chrome://marionette/content/transport.js:501:20
[task 2019-09-12T23:56:22.438Z] 23:56:22 INFO -
[task 2019-09-12T23:56:22.438Z] 23:56:22 INFO - Buffered messages logged at 23:54:07
[task 2019-09-12T23:56:22.439Z] 23:56:22 INFO - Longer timeout required, waiting longer... Remaining timeouts: 3
[task 2019-09-12T23:56:22.439Z] 23:56:22 INFO - Buffered messages logged at 23:54:52
[task 2019-09-12T23:56:22.439Z] 23:56:22 INFO - Longer timeout required, waiting longer... Remaining timeouts: 2
[task 2019-09-12T23:56:22.439Z] 23:56:22 INFO - Buffered messages logged at 23:55:37
[task 2019-09-12T23:56:22.439Z] 23:56:22 INFO - Longer timeout required, waiting longer... Remaining timeouts: 1
[task 2019-09-12T23:56:22.439Z] 23:56:22 INFO - Buffered messages finished
[task 2019-09-12T23:56:22.441Z] 23:56:22 INFO - TEST-UNEXPECTED-FAIL | devtools/client/webreplay/mochitest/browser_dbg_rr_breakpoints-01.js | Test timed out -
[task 2019-09-12T23:56:22.442Z] 23:56:22 INFO - Removing tab.
[task 2019-09-12T23:56:22.442Z] 23:56:22 INFO - Waiting for event: 'TabClose' on [object XULElement].
[task 2019-09-12T23:56:22.442Z] 23:56:22 INFO - Got event: 'TabClose' on [object XULElement].
[task 2019-09-12T23:56:22.442Z] 23:56:22 INFO - Tab removed and finished closing
[task 2019-09-12T23:56:22.442Z] 23:56:22 INFO - GECKO(1639) | JavaScript error: resource://testing-common/PromiseTestUtils.jsm, line 112: uncaught exception: Object
[task 2019-09-12T23:56:22.442Z] 23:56:22 INFO - Console message: [JavaScript Error: "uncaught exception: Object" {file: "resource://testing-common/PromiseTestUtils.jsm" line: 112}]
[task 2019-09-12T23:56:22.442Z] 23:56:22 INFO - GECKO(1639) | MEMORY STAT vsizeMaxContiguous not supported in this build configuration.
[task 2019-09-12T23:56:22.443Z] 23:56:22 INFO - GECKO(1639) | MEMORY STAT | vsize 7607MB | residentFast 327MB | heapAllocated 91MB
[task 2019-09-12T23:56:22.443Z] 23:56:22 INFO - TEST-OK | devtools/client/webreplay/mochitest/browser_dbg_rr_breakpoints-01.js | took 180353ms
[task 2019-09-12T23:56:22.443Z] 23:56:22 INFO - checking window state

Status: RESOLVED → REOPENED
Flags: needinfo?(dwalsh)
Resolution: FIXED → ---
Target Milestone: Firefox 71 → ---
Pushed by dwalsh@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/6536c8bf1bb5
Restructure inline-preview action for better performance r=jlast
Status: REOPENED → RESOLVED
Closed: 5 years ago5 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 71
Flags: needinfo?(dwalsh)

Just an idea to try out. If we land a performance fix, lets make sure to share in the bug the confirmed change in metrics (or no change). ni? david to post it here when its available.

Flags: needinfo?(dwalsh)

I should have better worded the bug title; the patch included obvious wins like:

  • Bailing out of a function before doing unnecessary parsing work
  • Changing successive await calls into one Promise.all

The resulting perf gain was negligible, per our dashboard, but a perf win no less.

Flags: needinfo?(dwalsh)

(In reply to David Walsh :davidwalsh from comment #9)

The resulting perf gain was negligible, per our dashboard, but a perf win no less.

+1.
Not all patches will have a positive impact on DAMP and this is fine. Typically if they speed up the test by less than its typical variance.
Or if it optimizes an edge case that is not covered by DAMP.
It is fine to land a fix as soon as you can assess the win by any mean like the profiler, manual console.log durations, ...

But we should be careful about just one thing. We should ensure that we exercice all important codepaths/features in one of the DAMP scripts.
So if you optimize an important feature/STR significantly, and you can assess that improvement by some other tooling, and DAMP doesn't react. There is most likely something to tweak in the DAMP test script related to this feature.

You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: