You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Hitting the first breakpoint when debugging seems quite slow compared to the old debugger #206
I'm using with the Extension Host debugger and it seems to take quite a while (many seconds) for the first breakpoint to be hit. Subsequent breakpoints seem fine.
Hm. Looking at the logs it seems like there's a delay, of varying size, between when we tell VS Code we stopped and when it requests a stack frames. Running on my machine this was 4-5 seconds, setting a breakpoint in extension.ts' activate.
...and in your logs it's around 10 seconds. Looking in VS Code sources, it seems like the 'threads' request gets fired off synchronously as soon as it sees a stopped event. The stop comes after we throw a whole lot of loadedSource requests over the connection, so I wondered if we had a queue that gets bogged down. We log the all events and their times on the adapter side, and I added a console.log(Date.now())here. There was a 5 second difference from when js-debug sent the event to when vs code processed it, which lines up with what I was seeing.
Logged send : 1578416835848
Logged received : 1578416840796 (+4948ms)
Running this case in the old debug adapter versus this one, node-debug2 emits 231 loadedSource events versus 1662 for js-debug; this is because js-debug reads and creates sources from the sourcemaps discovered at runtime, whereas node-debug2 does not factor in source maps to loaded scripts.
Possible solutions:
Don't emit loaded scripts for source maps. I don't want to do this, since having sourcemapped scripts makes the panel much more valuable when dealing with bundlers. Doing web or extension work and only being able see the big webpack-compiled bundle (that might be mangled with eval-sourcemaps) is not useful.
Fix the slowness in VS Code's processing of events.
Allow us to bulk together loadedSource events in DAP to reduce total message count; those 1.6k messages happen over a second or two, and could be easily debounced and bulked.
Yeah, I have definitely seen a wide variance in delays -- sometimes (and it feels like for certain breakpoints) things can happen quickly, and for others it can take a long time (and I should note I'm on a very fast desktop machine).
I can also reproduce some slowness in some other cases (when running vscode unit tests the time it takes to hit the first breakpoint can be slow).
Let's first try to fix 2)
My suspect is this PR microsoft/vscode#81403
Since when reverting it I could not see big slowness on my machine Connor Peet (@connor4312) can you please check if reverting that PR makes a difference for you? And if yes could we either revert or improve that PR such that the slowdown is not so signifcant?
Activity
connor4312 commentedon Jan 6, 2020
Can you toss a log up for this? 🙂
eamodio commentedon Jan 6, 2020
Both logs are hitting the same breakpoint after a clean start.
vscode-debugadapter.zip
This one too much longer than the first.
vscode-debugadapter (2).zip
connor4312 commentedon Jan 7, 2020
Hm. Looking at the logs it seems like there's a delay, of varying size, between when we tell VS Code we stopped and when it requests a stack frames. Running on my machine this was 4-5 seconds, setting a breakpoint in extension.ts' activate.
...and in your logs it's around 10 seconds. Looking in VS Code sources, it seems like the 'threads' request gets fired off synchronously as soon as it sees a stopped event. The stop comes after we throw a whole lot of
loadedSourcerequests over the connection, so I wondered if we had a queue that gets bogged down. We log the all events and their times on the adapter side, and I added aconsole.log(Date.now())here. There was a 5 second difference from when js-debug sent the event to when vs code processed it, which lines up with what I was seeing.Running this case in the old debug adapter versus this one, node-debug2 emits 231
loadedSourceevents versus 1662 forjs-debug; this is because js-debug reads and creates sources from the sourcemaps discovered at runtime, whereas node-debug2 does not factor in source maps to loaded scripts.Possible solutions:
Isidor Nikolic (@isidorn) thoughts?
eamodio commentedon Jan 7, 2020
Yeah, I have definitely seen a wide variance in delays -- sometimes (and it feels like for certain breakpoints) things can happen quickly, and for others it can take a long time (and I should note I'm on a very fast desktop machine).
isidorn commentedon Jan 8, 2020
I can also reproduce some slowness in some other cases (when running vscode unit tests the time it takes to hit the first breakpoint can be slow).
Let's first try to fix 2)
My suspect is this PR microsoft/vscode#81403
Since when reverting it I could not see big slowness on my machine
Connor Peet (@connor4312) can you please check if reverting that PR makes a difference for you? And if yes could we either revert or improve that PR such that the slowdown is not so signifcant?
connor4312 commentedon Jan 8, 2020
That indeed seems to be the case, reverting it drops the delta from ~5s to 43ms. I'll take a look at the PR this afternoon and see what we can do.
isidorn commentedon Jan 8, 2020
Great, thanks!
connor4312 commentedon Jan 13, 2020
Should be fixed in tomorrow's insiders. Reopen if not :)
fix(debug): don't insert task boundaries between events (#88459)