Description
tl;dr; The flat classpath implementation is much slower during the Sbt dependency analysis. For a project with a large classpath it's around 1.5s vs. 300ms with the recursive implementation.
I will use 2.11 as a reference point because the recursive classpath was removed in 2.12. However, timings carry over to the 2.12 compiler.
I'm using https://github.com/guardian/frontend/ for benchmarking (more precisely, the applications
subproject), which has a (very) large classpath. The time seems to be correlated to the size of the classpath and not so much with sources. The timings I got with the default 2.11 classpath (recursive):
[info] [Extracts dependency information in 232ms]
and with the flat one:
[info] [Extracts dependency information in 4985ms]
The 2.12 branch has a fix by @lrytz to speedup the classpath implementation, but even with this fix applied in the 2.11 branch the phase is about 5x slower:
[info] [Extracts dependency information in 1411ms]
At first glance, a lot of time seems to be spent in string manipulation and growing arrays. This is using VisualVM, so maybe the profiler isn't the best there is, however I think it points in the right direction.
PS. The timings with 2.12.2 for this phase are in the order of seconds, so it leads me to think the regression is still there, even though I didn't have a recursive classpath implementation for 2.12 to compare it against.