Cache asSeenFrom results per context - #26778
Draft
tanishiking wants to merge 2 commits into
Draft
Conversation
| else | ||
| val cache = ctx.asSeenFromCache | ||
| val key = (tp, pre, cls) | ||
| val cached = cache.lookup(key) |
Contributor
There was a problem hiding this comment.
GenericHashMap has a getOrElseUpdate to avoid doing the hashing/lookup twice, I think it can be used here? Although I guess the stats need to become "total requests" + "miss" instead.
Member
|
Benchmarks started. Workflow run. |
Member
|
Benchmarks completed. Overview. |
Contributor
|
Nice win for |
Member
Author
|
Yeah, we can't merge this as-is 😞 I'll take a look how can we reduce the regress / improve cache hit rate at some point. silverlining: what we changed in this PR is adding a small number of allocation, storing to cache, and |
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.
Fixes #26777
Cache
TypeOps$.asSeenFrom. Described details on #26777Have you relied on LLM-based tools in this contribution?
Yes, mostly for discussing how to cache
TypeOps$.asSeenFromsafely, and ended up storing cache inContextand usingGenericHashMapfor it's keys (but I'm doubting about this 🤔 )How was the solution tested?
Covered by existing tests (this is a refactoring)