Skip to content

Conversation

crt-31
Copy link
Contributor

@crt-31 crt-31 commented Jul 8, 2024

Refactored SourceLookUpProvider.loadClassesByScalaName() to be more efficient.

The issue presented itself in 4.0.0 (related to the HotCodeReplace feature). The debug loading times became really slow.

On my large project, the loading went from 75s back to a normal 12s. (12s is about what I saw in v3.1.6).

This should resolve scalameta/metals#6544

@adpi2
Copy link
Member

adpi2 commented Jul 8, 2024

Thanks for your contribution @crt-31

Using the SourceLookUpProviderStats we can clearly see the speedup:

Before After
ubuntu-latest 1510 ms 830 ms
windows-latest 2299 ms 1297 ms
macOS-latest 1682 ms 633 ms

I also wonder if we could make it even faster using a mutable.Map.

@adpi2 adpi2 merged commit fa41457 into scalacenter:main Jul 8, 2024
@adpi2
Copy link
Member

adpi2 commented Jul 8, 2024

I am going to release this asap.

@crt-31 thanks again! Feel free to open new pull requests if you see any other hot spot :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants