New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PERF: introduce RsCachedImplItem
#4182
Merged
Merged
Conversation
This file contains 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
vlad20012
force-pushed
the
perf-put-resolved-trait-to-TraitImplSource
branch
3 times, most recently
from
July 25, 2019 19:31
748ba98
to
76ef5e1
Compare
vlad20012
changed the title
PERF: add a resolved trait to
PERF: introduce Jul 25, 2019
TraitImplSource.ExplicitImpl
RsCachedImplItem
vlad20012
force-pushed
the
perf-put-resolved-trait-to-TraitImplSource
branch
from
July 26, 2019 15:15
76ef5e1
to
489dfe3
Compare
Undin
reviewed
Jul 26, 2019
vlad20012
force-pushed
the
perf-put-resolved-trait-to-TraitImplSource
branch
4 times, most recently
from
July 28, 2019 07:12
4ebaf32
to
0499463
Compare
Fixed |
Undin
reviewed
Jul 28, 2019
src/main/kotlin/org/rust/lang/core/resolve/ref/RsResolveCache.kt
Outdated
Show resolved
Hide resolved
vlad20012
force-pushed
the
perf-put-resolved-trait-to-TraitImplSource
branch
from
July 28, 2019 09:03
0499463
to
5634a0f
Compare
This optimizes trait selection and method resolve by reducing cache and PSI tree access. The idea is to combine all stuff related to impl item (implemented trait, type, crate root, etc) into one data class and place it to the cache (with impl item as a cache key)
vlad20012
force-pushed
the
perf-put-resolved-trait-to-TraitImplSource
branch
from
July 28, 2019 09:09
5634a0f
to
fcc0724
Compare
Fixed |
Undin
approved these changes
Jul 28, 2019
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great!
bors r+
bors bot
added a commit
that referenced
this pull request
Aug 5, 2019
4210: PERF: reduce PSI tree access in very hot item resolution r=vlad20012 a=vlad20012 Depends on #4190 This speeds up highlighting up to 5% (the baseline is before #4179) The approach is similar to #4182 - make more things accessible by one cache key and retrieve them together to reduce **PSI** (in the case of this PR) and cache access in very hot code. Co-authored-by: vlad20012 <beskvlad@gmail.com>
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.
I found this place during the recent performance investigation. This speeds up type inference up to 30% (!!!) (the baseline is before #4179)