-
Notifications
You must be signed in to change notification settings - Fork 290
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Incremental Performance Degradation with session.customRequest("variables") Calls #2119
Comments
DAP is just a protocol, this would be in the JS debugger |
Thanks for your quick reply, and I'm sorry for the mix-up |
I believe this is because we use a custom function sent to the runtime to generate property previews. This causes a new 'script' to be parsed and evaluated in the runtime. Unfortunately, CDP does not give us a way to 'release' these scripts, nor reuse a script/function that we can call again for each variable without a new script being parsed. However, I observe that with support for clickable functions, we now call this for each function in a scope eagerly, which makes certain scopes like global scopes much more expensive. vscode-js-debug/src/adapter/variableStore.ts Lines 979 to 982 in 4e9f6b8
Instead, we can just call the fast |
@neklesayurii can you verify this is improved on nightly? https://github.com/microsoft/vscode-js-debug?tab=readme-ov-file#nightly-extension |
I've noticed that each time I call session.customRequest("variables") within a single debug session, the response time increases.
Restarting the debugger is the only way I've found to reset this slowdown, but I'd love to find a way to clear or reset any internal state or cache that might be causing this performance drop.
(I try to dump stack variables during debugging in extension)
System Info:
Example Timing
I'm unsure if this is an issue with DAP or the debugger itself, but any tips on handling this without needing a full restart would be great!
The text was updated successfully, but these errors were encountered: