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
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.
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:
Issue happens on scala 2.13.14 and 2.13.10... Haven't tried any other versions
Using Correto 17.0.11 & Hotspot 17.0.6.10
Confirmed issue happens on latest main of Scala Debug Adapter
Used Flight Recorder to narrow down to the isLazyGetter function. The slowness went away when I commented that line out.
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.
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: