improve setBreakpointAtGeneratedLocation performance
Categories
(DevTools :: Debugger, enhancement, P2)
Tracking
(Not tracked)
People
(Reporter: jlast, Unassigned)
References
(Blocks 1 open bug)
Details
General Debugger slowness (https://github.com/devtools-html/debugger.html/issues/7734) helped us find a slow path setBreakpointAtGeneratedLocation.
Brian shared some comments in slack:
It looks like setBreakpointAtGeneratedLocation will be very expensive on large projects, both on the platform and on the devtools server side
If there's a single bundle of 14MB of JS code, all in one file and all (probably?) on one line in the generated source every time we set a breakpoint, generatedSourceActor._findDebuggeeScripts will enumerate every script in that bundle of JS code since the breakpoint is presumably a column breakpoint (if it was set from a location in the source mapped file) we then iterate through every one of those scripts and get the column of every pc in the script to compute a map look through that map to see if any of the columns falls in the range of the location we are trying to set the breakpoint at.
I don't think it's surprising that this could take a half second on a large project. It could be O(log N), if we do a binary search.
I wouldn't worry about other performance bottlenecks here until the computational complexity here is where it should be.
We had problems like this a lot in spidermonkey and fixing them can be a huge boost in performance, even on smaller apps where it isn't as noticeable.
What I think would be a good next step, actually, is create an example extremely large webapp that has a similar size / characteristics to salomvary's app. It would be easier to experiment with fixes and would have simpler profiles, we could easily measure the effects of fixes.
| Reporter | ||
Comment 1•7 years ago
|
||
| Reporter | ||
Comment 2•7 years ago
|
||
I think this will benefit from Logan's breakpoint specificity work --
Updated•7 years ago
|
| Reporter | ||
Updated•7 years ago
|
Updated•6 years ago
|
Updated•6 years ago
|
Updated•6 years ago
|
Updated•3 years ago
|
Description
•