typing/perf 2/4: QW1+QW2 hygiene — in-place single-MATCH check, fewer clones - #81
Open
Felipe705x wants to merge 1 commit into
Open
typing/perf 2/4: QW1+QW2 hygiene — in-place single-MATCH check, fewer clones#81Felipe705x wants to merge 1 commit into
Felipe705x wants to merge 1 commit into
Conversation
…ones - check_query: a single non-optional MATCH is checked in place instead of through collapsed_pattern(), which for one match is exactly "deep- clone the whole pattern AST". Multi-match keeps the Join collapse. - TypeEnvironment::keys() returns an iterator (no Vec per call); new iter()/set_shared() let env merges share Rc bindings instead of deep-cloning descriptor trees (the Filter ambient merge did one deep clone per binding). - warn_for_collapsed_bindings iterates bindings directly (no key Vec, no double hash lookups). - check_subquery_body seeds its fold from the outer env directly — one up-front clone (the ambient push) instead of two per subquery. Measured effect (pattern_typecheck, LDBC SF0.1 schema): within noise on every category (chain_16 448 → 436 us, subq_exists 69.1 → 68.4 us) — claimed as hygiene, not as a win. The schema-scan term dominates; that is QW3/QW4 territory. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.
Stacked on #80.
check_query: single non-optional MATCH checked in place (skips thecollapsed_pattern()AST deep-clone; multi-match unchanged).TypeEnvironment::keys()→ iterator; newiter()/set_shared()so env merges shareRcbindings instead of deep-cloning descriptor trees.warn_for_collapsed_bindingsiterates bindings directly (no key Vec, no double lookups).check_subquery_body: one up-front env clone instead of two.Measured effect: within noise on every category (chain_16 448 → 436 µs, subq_exists 69.1 → 68.4 µs). Claimed as hygiene, not a win — kept because risk-free and it cleans the hot path for the following PRs.
🤖 Generated with Claude Code