perf: Do not check solver's cache validity on every access#22104
Merged
ChayimFriedman2 merged 1 commit intorust-lang:masterfrom Apr 20, 2026
Merged
perf: Do not check solver's cache validity on every access#22104ChayimFriedman2 merged 1 commit intorust-lang:masterfrom
ChayimFriedman2 merged 1 commit intorust-lang:masterfrom
Conversation
Contributor
Author
|
This would really benefit from perf run like rustc, but we only have after-merge perf stats... So I'll just bite the bullet and merge this. |
fe022f2 to
8ee187e
Compare
This should help speed. Instead, we do it only when an `Interner` is constructed, since an interner cannot be held across revisions. There is a problem, though: an interner *can* be held across different databases. To solve that, we also reinit the cache when attaching databases, and take the assumption that everything significant (i.e. that can access the cache) will need to attach the db. This is somewhat risky, but we'll take it for the speed. Theoretically we could *only* reinit on db attach, but it's less risky this way, and with-crate interner construction is rare.
8ee187e to
3e4c332
Compare
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.
This should help speed.
Instead, we do it only when an
Interneris constructed, since an interner cannot be held across revisions.There is a problem, though: an interner can be held across different databases. To solve that, we also reinit the cache when attaching databases, and take the assumption that everything significant (i.e. that can access the cache) will need to attach the db. This is somewhat risky, but we'll take it for the speed.
Theoretically we could only reinit on db attach, but it's less risky this way, and with-crate interner construction is rare.