JS Tracer can be very slow when debugging google docs
Categories
(DevTools :: Debugger, defect)
Tracking
(firefox132 fixed)
Tracking | Status | |
---|---|---|
firefox132 | --- | fixed |
People
(Reporter: ochameau, Assigned: ochameau)
References
(Blocks 1 open bug)
Details
Attachments
(4 files)
The JS Tracer can be very slow and freeze the page for a few seconds to process the traces.
This is visible on the profiler:
https://share.firefox.dev/4d8NtTr
There is three performance issues with the following methods:
- getFrameDepth
- getFrameIndex
- isBlackBoxed
Assignee | ||
Comment 1•5 months ago
|
||
These checks represent a sizeable part of computations in the traced thread when using the JS Tracer.
Updated•5 months ago
|
Assignee | ||
Comment 2•5 months ago
|
||
We don't have to walk up to the top frame if any of the parent frame
already has its depth computed.
Assignee | ||
Comment 3•5 months ago
|
||
Using unique strings as keys for Map is actually costly because
the string is "atomized" in order to uniquely identify it.
Assignee | ||
Comment 4•4 months ago
|
||
Assignee | ||
Comment 5•4 months ago
|
||
A quick summary about the impact of all these patches.
I measure the time spent tracing while typing three characters in gdocs.
First, I recorded mozilla-central:
https://share.firefox.dev/4d8NtTr
And got the following time spent in the few optimized methods:
- getFrameDepth (963ms)
- onTracingFrame (632ms)
- getFrameIndex (244ms)
- isBlackBoxed (69ms)
attachment 9425780 [details] Fixed isBlackBoxed
https://share.firefox.dev/3XMLZtw
- isBlackBoxed (4ms)
attachment 9425781 [details] Fixed getFrameDepth
https://share.firefox.dev/4d6J7wh
- getFrameDepth (89ms)
attachment 9425782 [details] Fixed getFrameIndex
https://share.firefox.dev/4gvNCDl
- getFrameIndex (126ms)
attachment 9426016 [details] Fix for clip-path
This one fix isn't targeting the page's content process, but the frontend rendering in the parent process.
Also I tested while typing 16 characters instead of 3, as it requires accumulating more events.
So here is a profile without this patch, for the parent process:
https://share.firefox.dev/3MR9VFX
- Paint (1045ms)
And one profile with this patch:
https://share.firefox.dev/3XQyLfE
- Paint (525ms)
Comment 7•4 months ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/c4d8cd9bafeb
https://hg.mozilla.org/mozilla-central/rev/eea86b9a31ec
https://hg.mozilla.org/mozilla-central/rev/ceab7816468c
https://hg.mozilla.org/mozilla-central/rev/26ea21eb3e27
Comment 8•4 months ago
|
||
Perfherder has detected a devtools performance change from push c09c9bd01da846a99ca184ce7b07708e360897c9.
Improvements:
Ratio | Test | Platform | Options | Absolute values (old vs new) |
---|---|---|---|---|
15% | damp jstracer.debugger-sidebar-performance.DAMP | windows11-64-shippable-qr | e10s fission stylo webrender | 1,047.23 -> 888.03 |
15% | damp jstracer.debugger-sidebar-performance.DAMP | windows11-64-shippable-qr | e10s fission stylo webrender | 1,046.65 -> 889.03 |
11% | damp jstracer.debugger-sidebar-performance.DAMP | macosx1015-64-shippable-qr | e10s fission stylo webrender | 1,940.69 -> 1,721.06 |
9% | damp jstracer.webconsole-performance.DAMP | windows11-64-shippable-qr | e10s fission stylo webrender | 1,264.04 -> 1,146.59 |
9% | damp jstracer.webconsole-performance.DAMP | macosx1015-64-shippable-qr | e10s fission stylo webrender | 2,286.98 -> 2,089.24 |
... | ... | ... | ... | ... |
2% | damp jstracer.server-performance.DAMP | windows11-64-shippable-qr | e10s fission stylo webrender | 819.33 -> 802.63 |
Details of the alert can be found in the alert summary, including links to graphs and comparisons for each of the affected tests.
If you need the profiling jobs you can trigger them yourself from treeherder job view or ask a sheriff to do that for you.
You can run these tests on try with ./mach try perf --alert 2278
For more information on performance sheriffing please see our FAQ.
Description
•