Skip to content

Performance Improvement#336

Merged
yhirose merged 14 commits intomasterfrom
performance
Mar 11, 2026
Merged

Performance Improvement#336
yhirose merged 14 commits intomasterfrom
performance

Conversation

@yhirose
Copy link
Copy Markdown
Owner

@yhirose yhirose commented Mar 11, 2026

Fix #316

yhirose and others added 14 commits March 8, 2026 10:26
…Scope

Replace push()/pop()/append()/shift_capture_values() with snapshot()
(record sizes) and rollback() (truncate on failure). Operators now write
directly to the parent SemanticValues and truncate on failure, eliminating
child scope allocation and copy-on-success overhead.

Key changes:
- PrioritizedChoice: snapshot/rollback instead of push/pop/append
- Sequence: direct write to parent (no child scope)
- AndPredicate/NotPredicate: always rollback (side-effect isolation)
- CaptureScope: flatten vector<map> to vector<pair> with reverse search
- Remove push()/pop()/append()/shift_capture_values() entirely

Benchmark (A/B, big.sql ~1.2MB): 105.4ms -> 99.2ms (-5.9%)
Small inputs benefit more (TPC-H Q1: -22.7%) where per-rule allocation
overhead is proportionally higher.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…in parsing

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@yhirose yhirose merged commit 60a77c6 into master Mar 11, 2026
10 checks passed
@yhirose yhirose deleted the performance branch March 11, 2026 04:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Performance improvement

1 participant