scalacenter / scala-debug-adapter

Implementation of the Debug Adapter Protocol for Scala

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Debugging very slow to start

Arthurm1 opened this issue · comments

When trying to debug this test using Bloop/Metals/VSCode/Windows, I find the debugger very slow to start (> 5 mins)

This is mainly because of

manySourceFiles.filter(s => findPackage(s, classFile.fullPackage, logger)) match {

It's being hit many times on the gradle 5.0 jar: https://repo1.maven.org/maven2/dev/gradleplugins/gradle-api/5.0/

The Gradle jar and its sources are pretty busy (>3K folders, >12K files) and source files often don't exist for the corresponding class file.

The only class that I've been able to pin down as constantly being searched for is package-info.class/package-info.java. Can this just be excluded from this area of code? AFAIK - there's never any runnable code in these files.

Another possible performance improvement could be to group these missing files by jar and then scan for all of them instead of opening/closing the jar FS for every class file.

Thanks for reporting this issue, starting the investigation and providing such level of details. I am taking a look.