Repository navigation
Cache parsed queries in the impact pass - #2725
Merged
Merged
Conversation
✅ Deploy Preview for thriving-cassata-78ae72 canceled.
|
shangyian
marked this pull request as ready for review
November 13, 2026 06:37
Contributor
[Medium impact] The PR appears safe to merge; no new actionable issue was found. SummaryAdds a bounded cache of parsed queries and returns a separate tree to each caller.
Reviews (3) · Last reviewed commit: "Route the fingerprint pass through the p..." · Reviewed by Greptile |
The impact pass parses every downstream query on each deploy, about 3 ms each, and ANTLR parsing holds the GIL so the threadpool does not help. Keep each tree pickled (about 4 KB, 0.1 ms to load) in a bounded least-recently-used cache so repeated deploys of the same text skip the parse. Trees built without parent links are never kept.
shangyian
force-pushed
the
perf/parse-cache
branch
from
November 13, 2026 18:09
f29ce2a to
04123f9
Compare
The fingerprint pass parsed the same query text again outside the cache. All four parse sites now share one cache keyed on the text and the parse mode.
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.
Summary
This PR adds a cache for parsed queries. Each cache hit rebuilds a separate tree so callers cannot change another caller's copy.
Test Plan
make checkpassesmake testshows 100% unit test coverageDeployment Plan