Repository navigation
Conversation
15r10nk
force-pushed
the
optimize-execution-cache-hits
branch
from
November 26, 2026 05:58
3fc01b3 to
77d232c
Compare
Key execution results by code identity and avoid rewriting existing class-local cache attributes. Retain regression coverage for distinct equal code objects and their lifetime.
15r10nk
force-pushed
the
optimize-execution-cache-hits
branch
from
November 26, 2026 16:53
77d232c to
fdfa61b
Compare
Benchmark ResultsTip 26 benchmark(s) improved
Improvements
95 unchanged benchmark(s)
Details
Raw asv-spyglass output |
Benchmark ResultsTip 34 benchmark(s) improved
Improvements
87 unchanged benchmark(s)
Details
Raw asv-spyglass output |
Benchmark ResultsTip 25 benchmark(s) improved
Improvements
96 unchanged benchmark(s)
Details
Raw asv-spyglass output |
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.
Source.executing()currently hashes the code object and rewrites a class-local cache attribute on every cache hit. Use(id(code), instruction_offset)as the lookup key and initialize class-local cache attributes only when absent. Retain the code object in the cached value to prevent its identity from being reused while the entry exists.Local Python 3.14 ASV measurements with the suite from #114 show cached large-function node lookups improving from 604 ms to 208 ms per 1,000 lookups (2.9×). Simple-call node lookups improve from 559 µs to 490 µs per 1,000 lookups (12% less time).