-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
StackTraceRequest is very slow after version 4.0.2 #780
Comments
Thanks for the report! I will need more information to address this issue:
|
Investigating the code further, it made sense since method.argumentTypes() sends request to the host and waits for response... also the problem appears to be exasperated by presense of anonymous functions such as for comprehensions and lambdas. Note, we are running a large application, I don't notice it in small applications. |
Thanks for the details! That's very helpful.
If you use VSCode, it only loads the top 10 frames and then you need to click to expand the entire stack. In other code editors, I don't know, maybe there is a similar feature that you can enable. But anyway I'll see if I can avoid this |
Thanks for addressing this. (Also, we are using VSCode & Metals) |
Then it should only load 10 frames, which should not be slow. So I guess it becomes slow only when you expand the entire stack? |
I'm not expanding or even really touching the vs code stack frame ui. |
@crt-31 Could you show me a screenshot of stacktrace that is slow to load? I'd like to determine if there is a pattern that makes it slow. |
Processing StackTraceRequest has become orders of magnitude slower since version 4.0.2, almost to a point where debugging is unusable. We are using Metals/Bloop, and everytime we debug break, the StackTraceRequest is sent and can take 5 to 10 seconds to process.
The regression seems to be caused by the new feature to add presentation hint for each method in the callstack.
The culprit seems to be in JdiExtensions.isLazyGetter which calls jdi.Method.argumentTypes(). jdi.Method.argumentTypes() seems to be an expensive function as it queries the host for all the fields. Doing this on every method in callstack is slowing things down.
scala-debug-adapter/modules/core/src/main/scala/ch/epfl/scala/debugadapter/internal/stacktrace/JdiExtensions.scala
Lines 45 to 49 in b2800f0
I don't have any great solutions to fix this, other than finding a way to not have to call isLazyGetter all the time, or maybe a config option to turn off presentationHint? Just ideas.
The text was updated successfully, but these errors were encountered: