Skip to content

StackTraceRequest is very slow after version 4.0.2 #780

Closed
@crt-31

Description

@crt-31

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.

def isLazyGetter: Boolean =
method.argumentTypes.asScala.toSeq match {
case Seq(argType) => lazyTypes.contains(argType.name)
case _ => false
}

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions