Closed
Bug 1239473
Opened 8 years ago
Closed 5 years ago
Stepping in debugger gets very slow with complex scripts and deep stacks
Categories
(DevTools :: Debugger, defect)
Tracking
(Not tracked)
RESOLVED
WONTFIX
People
(Reporter: hsteen, Unassigned)
References
Details
Attachments
(1 file)
5.87 MB,
text/plain
|
Details |
I've long been frustrated by the debugger sometimes being slow when used for real-life tasks with complex scripts. The test I've been developing for bug 1154874 seems to prove that there is a reproducable, measurable slowdown when the stack grows. It would be great to have some optimisations done here!
Reporter | ||
Comment 1•8 years ago
|
||
(By "very slow" I mean a lag of 0.5 - 2 (!) seconds for each "Step into" ([F11]) - this is maddening if you're trying to get a quick overview of how some code runs)
Comment 2•8 years ago
|
||
(In reply to Hallvord R. M. Steen [:hallvors] from comment #1) > (By "very slow" I mean a lag of 0.5 - 2 (!) seconds for each "Step into" > ([F11]) - this is maddening if you're trying to get a quick overview of how > some code runs) Can you use the browser toolbox to collect a performance profile while reproducing this issue and upload it here?
Reporter | ||
Comment 3•8 years ago
|
||
Here's some data, captured when stepping manually in the bug 1154874 test with a pretty deep stack. I noticed significantly better performance when the devtools pane was docked to the side of the window rather than underneath. There's probably some data for each configuration in this json file.
Comment 4•8 years ago
|
||
(In reply to Hallvord R. M. Steen [:hallvors] from comment #3) > Created attachment 8708267 [details] > debugger-stepping-profile.json > > Here's some data, captured when stepping manually in the bug 1154874 test > with a pretty deep stack. I noticed significantly better performance when > the devtools pane was docked to the side of the window rather than > underneath. There's probably some data for each configuration in this json > file. Interesting. pullTimelineData seems to be transitively taking a huge chunk of the time here (see the flame view), which is overhead caused by the act of profiling... Seeing pauses on the order of 200-1000ms... not good :-/ Jordan, Victor: any idea how we can make pullTimelineData faster, or do less work, or do it less often, or something? This is p bad IMO. I am also seeing some pauses from StackFrames.prototype._afterFramesCleared and StackFramesView.prototype.selectFrame, et al in debugger-controller.js but these are on the order of 50-100ms, which is also pretty bad but pales in comparison to the above.
Flags: needinfo?(vporof)
Flags: needinfo?(jsantell)
Comment 5•8 years ago
|
||
Looks like pullTimelineData, the function that gathers fresh markers from docshell, is mostly spending its time in StackFramesView.prototype.makeEvent (iterating over the array?) -- lots of `values`, `CreateArrayIterator`, and `next` functions underneath that, self-hosted, so guessing it's something with that loop. This is a very marker heavy profile -- all the more reason to introduce non-realtime markers, because the overhead just gets more costly.
Flags: needinfo?(jsantell)
Reporter | ||
Comment 6•8 years ago
|
||
I'm curious if the debugger adds elements for everything in the stack to the DOM when it's in "landscape mode" and you have the "bread crumb"-style strip of stack frame history.. If it does it would probably explain some of the slowness and the difference between docking the debugger at the bottom ("landscape mode") and right ("portrait mode").
Comment 7•8 years ago
|
||
Agree with Jordan said. Maybe we should just bite the bullet and accept the fact that realtime markers cost too much with little benefit.
Flags: needinfo?(vporof)
Comment 8•7 years ago
|
||
Is this an issue for the debugger in general or only when it's profiling?
Updated•6 years ago
|
Product: Firefox → DevTools
Comment 9•5 years ago
|
||
closing as this is related to the old debugger.
Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → WONTFIX
You need to log in
before you can comment on or make changes to this bug.
Description
•