Skip to content
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 1 commit into from Jul 28, 2019

Conversation

vlad20012
Copy link
Member

@vlad20012 vlad20012 commented Jul 25, 2019

I found this place during the recent performance investigation. This speeds up type inference up to 30% (!!!) (the baseline is before #4179)

@vlad20012 vlad20012 force-pushed the perf-put-resolved-trait-to-TraitImplSource branch 3 times, most recently from 748ba98 to 76ef5e1 Compare July 25, 2019 19:31
@vlad20012 vlad20012 changed the title PERF: add a resolved trait to TraitImplSource.ExplicitImpl PERF: introduce RsCachedImplItem Jul 25, 2019
@Undin Undin added the fix Pull requests that fix some bug(s) label Jul 26, 2019
@vlad20012 vlad20012 force-pushed the perf-put-resolved-trait-to-TraitImplSource branch from 76ef5e1 to 489dfe3 Compare July 26, 2019 15:15
@vlad20012 vlad20012 force-pushed the perf-put-resolved-trait-to-TraitImplSource branch 4 times, most recently from 4ebaf32 to 0499463 Compare July 28, 2019 07:12
@vlad20012
Copy link
Member Author

Fixed

@vlad20012 vlad20012 force-pushed the perf-put-resolved-trait-to-TraitImplSource branch from 0499463 to 5634a0f Compare July 28, 2019 09:03
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 vlad20012 force-pushed the perf-put-resolved-trait-to-TraitImplSource branch from 5634a0f to fcc0724 Compare July 28, 2019 09:09
@vlad20012
Copy link
Member Author

Fixed

Copy link
Member

@Undin Undin left a 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 Jul 28, 2019
4182: PERF: introduce `RsCachedImplItem` r=Undin a=vlad20012

I found this place during the recent performance investigation. This speeds up type inference up to 30% (!!!) (the baseline is before #4179)

Co-authored-by: vlad20012 <beskvlad@gmail.com>
@bors
Copy link
Contributor

bors bot commented Jul 28, 2019

@bors bors bot merged commit fcc0724 into master Jul 28, 2019
@bors bors bot deleted the perf-put-resolved-trait-to-TraitImplSource branch July 28, 2019 11:32
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>
@Undin Undin added this to the v103 milestone Aug 5, 2019
@Undin Undin added this to Done in To test Aug 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fix Pull requests that fix some bug(s)
Projects
To test
  
Done
Development

Successfully merging this pull request may close these issues.

None yet

2 participants