Lazy loading of locals / thread-specific variable loading? #165
-
|
Hello! I’m currently using In that setup, when all threads attempt to load their locals simultaneously, stepping through code can become very slow, and the UI may take a long time to populate variables (multiple seconds to more than a minute). I have not tried
A lazy-loading approach (only fetching data for the active thread unless explicitly requested) would significantly improve responsiveness in high-latency, multi-threaded debugging scenarios like mine. If this is already supported, it might be worth highlighting in the documentation; it would be a strong advantage over other UIs. Thanks for your work on this plugin! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
|
Hey,
I need to understand your setup a little better. There could be multiple things at play here. Without the specifics, these are just guesses:
Yep.
The variables are fetched "on demand" in the sense that the expansions are not eagerly loaded (this would be straight up expensive for no reason). But overall, performance hasn't been a major concern. In fact, out of correctness, there's lots of "redundant" work (which I could into specifics if you'd like to hear).
As mentioned, the data for scopes is only fetched for the current, stopped thread.
I wouldn't label
❤️ |
Beta Was this translation helpful? Give feedback.
-
|
Hi! I was able to test For reference, the behaviour I hit with That said, I’m working with a c++ application with around 10-20 threads. I use In that context, I think further improvements would come from pushing laziness even further and only fetch data for what is strictly visible (again, I have not read the source code, maybe that behaviour is already partly/fully implemented):
Overall, Thanks once again for your answer and great plugin 😄 It really saved my day at work this week! |
Beta Was this translation helpful? Give feedback.
Hey,
I need to understand your setup a little better. There could be multiple things at play here. Without the specifics, these are just guesses:
nvim-dap-ui? By default,nvim-dapinjects the variables for each scope within the stopped thread. You mention this issue only happens in a multi-thread setup, but this could be the underlying cause.nvim-dap,nvim-dap-uiandnvim-d…