Optimize the getColumnBreakpoints selector
Categories
(DevTools :: Debugger, enhancement)
Tracking
(firefox120 fixed)
| Tracking | Status | |
|---|---|---|
| firefox120 | --- | fixed |
People
(Reporter: ochameau, Assigned: ochameau)
References
(Blocks 2 open bugs)
Details
Attachments
(2 files)
Here is a record of bug 1843454 STR:
https://share.firefox.dev/3Lwgcqi
On this 50s record, we spend 1.5s in getColumnBreakpoints selector:
https://searchfox.org/mozilla-central/rev/077fc34d03b85b09add26b5f99f1a3a3a72c8720/devtools/client/debugger/src/selectors/visibleColumnBreakpoints.js#124-151
This probably causes some junks as it happens in the main thread.
Following this str, we do manipulate an array with 260k elements.
Quickly looking at its implementation, there is lots of room for improvement.
| Assignee | ||
Comment 1•2 years ago
|
||
Checking for isOriginal boolean is much faster as it avoid a string comparison and function calls.
| Assignee | ||
Comment 2•2 years ago
|
||
filterByLineCountwas just a very costly non-sense filtering nothing.
(comes from unreviewed code https://github.com/firefox-devtools/debugger/pull/7349)- The filter using lineText isn't clear either.
Why would breakpoint position include breakpoint after the end of the actual line text content??
| Assignee | ||
Comment 3•2 years ago
|
||
With the attached patch, I get down to less than 180ms spent in this selector.
https://share.firefox.dev/48r2z5K
Updated•2 years ago
|
| Assignee | ||
Comment 4•2 years ago
|
||
Comment 6•2 years ago
|
||
| bugherder | ||
https://hg.mozilla.org/mozilla-central/rev/409956a5ade5
https://hg.mozilla.org/mozilla-central/rev/9feea518d33a
Comment 7•2 years ago
|
||
== Change summary for alert #39943 (as of Thu, 12 Oct 2023 20:34:05 GMT) ==
Improvements:
| Ratio | Test | Platform | Options | Absolute values (old vs new) |
|---|---|---|---|---|
| 5% | damp custom.jsdebugger.stepIn.DAMP | linux1804-64-shippable-qr | e10s fission stylo webrender-sw | 567.13 -> 539.64 |
| 4% | damp custom.jsdebugger.pretty-print.reload-and-pause.DAMP | macosx1015-64-shippable-qr | e10s fission stylo webrender | 8,510.49 -> 8,211.90 |
| 3% | damp custom.jsdebugger.stepInNewSource.DAMP | windows10-64-shippable-qr | e10s fission stylo webrender | 569.72 -> 552.27 |
| 3% | damp custom.jsdebugger.pretty-print.reload-and-pause.DAMP | macosx1015-64-shippable-qr | e10s fission stylo webrender-sw | 8,460.01 -> 8,206.87 |
| 3% | damp custom.pretty-print.jsdebugger.reload.DAMP | macosx1015-64-shippable-qr | e10s fission stylo webrender | 8,304.10 -> 8,059.49 |
| 2% | damp custom.jsdebugger.pretty-print.reload-and-pause.DAMP | windows10-64-shippable-qr | e10s fission stylo webrender | 8,308.96 -> 8,108.50 |
For up to date results, see: https://treeherder.mozilla.org/perfherder/alerts?id=39943
Description
•