Improve the performance of `setBreakpointPositions` action
Categories
(DevTools :: Debugger, enhancement)
Tracking
(Not tracked)
People
(Reporter: ochameau, Assigned: ochameau)
References
(Blocks 1 open bug)
Details
Attachments
(5 files)
In bug 1843454 profiler records:
https://share.firefox.dev/45i4Oph
We can see that we spend almost a second in setBreakpointPositions
action.
This action is actually cloning and parsing a 200k array many times, while also going through many intermediate objects.
We can drastically optimize this by avoiding the use of Array's filter method.
Assignee | ||
Comment 1•2 months ago
|
||
This code is a bit hard to follow, so let's add some comments.
Also columns = [...new Set([...existing, ...columns])];
is probably very bad for performance.
It clones existing and columns into a third array, whose content is cloned into a Set,
which is ultimately cloned into the final array.
Updated•2 months ago
|
Assignee | ||
Comment 2•2 months ago
|
||
Assignee | ||
Comment 3•2 months ago
|
||
We can avoid the creation of an handful of object creations by passing
the "breakpoint positions" objects directly to the Source Map Loader.
(avoid convertToList)
We can also tune SourceMapLoader.getOriginalLocations
output to better
fit the requirements of the main thread.
Assignee | ||
Comment 4•2 months ago
|
||
The filterBySource was looping over the whole list once again
but worse, was duplicating the array once more.
Same for filterByUniqLocation.
Finally, once we removed these two last filtering methods... we could prevent the creation of the whole "positions"
intermediate object and craft directly what we aim to store in redux.
Pushed by apoirot@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/caeaed53f213 [devtools] Document breakable position retrieval and avoid instation of many Sets and Arrays. r=devtools-reviewers,nchevobbe https://hg.mozilla.org/integration/autoland/rev/8a22579ffeda [devtools] Drop unused options/search argument to getOriginalLocation(s). r=devtools-reviewers,nchevobbe https://hg.mozilla.org/integration/autoland/rev/493f560d9831 [devtools] Better integrate SourceMapLoader into breakable positions computation. r=devtools-reviewers,nchevobbe https://hg.mozilla.org/integration/autoland/rev/775a3be92f25 [devtools] Avoid duplicating the large breakpoints positions array when using function filtering methods. r=devtools-reviewers,nchevobbe
Comment 6•2 months ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/caeaed53f213
https://hg.mozilla.org/mozilla-central/rev/8a22579ffeda
https://hg.mozilla.org/mozilla-central/rev/493f560d9831
https://hg.mozilla.org/mozilla-central/rev/775a3be92f25
Comment 7•25 days ago
|
||
Depends on D193535
Pushed by djackson@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/39ecb02fd8de Fix PSM test which relied on removed Verisign Cert. r=nss-reviewers,bbeurdouche
Comment 9•25 days ago
|
||
Backed out for causing doc-generate failures
Backout link: https://hg.mozilla.org/integration/autoland/rev/0af2bfddc084f01eb052a0bbd79ce7801981e9e5
Comment 10•24 days ago
|
||
Pushed by djackson@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/3bdf62c4b0fa Fix PSM test which relied on removed Verisign Cert. r=nss-reviewers,bbeurdouche
Comment 11•24 days ago
|
||
Backed out for refering the wrong bug.
Backout link: https://hg.mozilla.org/integration/autoland/rev/63cbca83011974bb18b3acd23b489f5577b83c3e
Updated•24 days ago
|
Updated•24 days ago
|
Description
•