Closed neklesayurii closed 3 weeks ago
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.
Instead, we can just call the fast Runtime.getProperties
which returns the location data we need without eagerly getting the representation for all properties.
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!