improvement: improve perfomance of the presentation compiler#25769
Merged
zielinsky merged 5 commits intoscala:mainfrom Apr 21, 2026
Merged
improvement: improve perfomance of the presentation compiler#25769zielinsky merged 5 commits intoscala:mainfrom
zielinsky merged 5 commits intoscala:mainfrom
Conversation
c571cbf to
7d631e7
Compare
zielinsky
reviewed
Apr 21, 2026
982d045 to
4476fda
Compare
Previously, we would calculate the scope twice when completions were invoked. First for printing and to make sure we don't have conflicts and then to get the actual completions. Now, we use the first context from IndexedContext, but we check the actual accessibility, which was not checked in IndexedContext as it was useing Lazy Scope.
zielinsky
approved these changes
Apr 21, 2026
mbovel
pushed a commit
to mbovel/dotty
that referenced
this pull request
May 4, 2026
…5769) ## How much have you relied on LLM-based tools in this contribution? Did some investigations using LLMs, but the code is mine. ## How was the solution tested? The tests are the same and I also run some benchmarks in the Metals codebase. ## Additional notes There are a few things that should improve performance: - we used to calculate scope completions twice, now we do it in the IndexedContext and later check accessiblity when needed - moved one name check into querying members instead of later - stopped calculating typed path multiple times, just once and construct everything from it. Performance seems mostly around the same as with Scala 2 except on empty completion. Need to investigate that later.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
How much have you relied on LLM-based tools in this contribution?
Did some investigations using LLMs, but the code is mine.
How was the solution tested?
The tests are the same and I also run some benchmarks in the Metals codebase.
Additional notes
There are a few things that should improve performance:
Performance seems mostly around the same as with Scala 2 except on empty completion. Need to investigate that later.