Cache compiled RegExp programs#677
Conversation
Compile RegExp patterns once during object construction and store the compiled program on the object for native execution paths. Closes #596
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (6)
📝 WalkthroughWalkthroughThis PR implements caching of compiled RegExp programs to eliminate recompilation overhead. A new ChangesRegExp Program Caching and Reuse
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Possibly related PRs
Suggested labels
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Comment |
Suite TimingTest Runner (interpreted: 9,736 passed; bytecode: 9,736 passed)
MemoryGC rows aggregate the main thread plus all worker thread-local GCs. Test runner worker shutdown frees thread-local heaps in bulk; that shutdown reclamation is not counted as GC collections or collected objects.
Benchmarks (interpreted: 407; bytecode: 407)
MemoryGC rows aggregate the main thread plus all worker thread-local GCs. Benchmark runner performs explicit between-file collections, so collection and collected-object counts can be much higher than the test runner.
Measured on ubuntu-latest x64. |
Benchmark Results407 benchmarks Interpreted: 🟢 73 improved · 🔴 55 regressed · 279 unchanged · avg +0.4% arraybuffer.js — Interp: 🟢 2, 🔴 2, 10 unch. · avg -1.3% · Bytecode: 🔴 14 · avg -27.4%
arrays.js — Interp: 🟢 6, 🔴 2, 11 unch. · avg +2.1% · Bytecode: 🔴 19 · avg -29.9%
async-await.js — Interp: 🔴 1, 5 unch. · avg -0.2% · Bytecode: 🔴 6 · avg -27.6%
async-generators.js — Interp: 2 unch. · avg +0.0% · Bytecode: 🔴 2 · avg -31.0%
base64.js — Interp: 🟢 3, 7 unch. · avg +0.2% · Bytecode: 🔴 10 · avg -20.8%
classes.js — Interp: 🟢 5, 🔴 3, 23 unch. · avg +0.5% · Bytecode: 🔴 31 · avg -23.9%
closures.js — Interp: 🟢 1, 🔴 3, 7 unch. · avg -0.3% · Bytecode: 🔴 11 · avg -29.0%
collections.js — Interp: 🔴 1, 11 unch. · avg -0.5% · Bytecode: 🔴 12 · avg -29.9%
csv.js — Interp: 🟢 2, 11 unch. · avg +0.8% · Bytecode: 🔴 13 · avg -27.6%
destructuring.js — Interp: 🟢 1, 21 unch. · avg +0.3% · Bytecode: 🔴 22 · avg -26.6%
fibonacci.js — Interp: 🟢 1, 7 unch. · avg +0.3% · Bytecode: 🔴 8 · avg -31.0%
float16array.js — Interp: 🟢 7, 🔴 3, 22 unch. · avg +0.7% · Bytecode: 🔴 32 · avg -26.8%
for-of.js — Interp: 🔴 1, 6 unch. · avg -0.8% · Bytecode: 🔴 7 · avg -31.7%
generators.js — Interp: 🟢 3, 1 unch. · avg +3.5% · Bytecode: 🔴 4 · avg -24.4%
iterators.js — Interp: 🟢 2, 🔴 13, 27 unch. · avg -1.1% · Bytecode: 🔴 42 · avg -26.2%
json.js — Interp: 🟢 3, 🔴 5, 12 unch. · avg -1.0% · Bytecode: 🔴 20 · avg -27.0%
jsx.jsx — Interp: 🟢 14, 7 unch. · avg +3.2% · Bytecode: 🔴 21 · avg -27.9%
modules.js — Interp: 🔴 2, 7 unch. · avg -1.9% · Bytecode: 🔴 9 · avg -33.9%
numbers.js — Interp: 🔴 1, 10 unch. · avg +0.4% · Bytecode: 🔴 11 · avg -26.8%
objects.js — Interp: 🟢 1, 6 unch. · avg +2.7% · Bytecode: 🔴 7 · avg -27.1%
promises.js — Interp: 🟢 2, 10 unch. · avg +0.7% · Bytecode: 🔴 12 · avg -23.7%
regexp.js — Interp: 🟢 1, 🔴 2, 8 unch. · avg -0.8% · Bytecode: 🔴 11 · avg -21.0%
strings.js — Interp: 🟢 5, 14 unch. · avg +2.0% · Bytecode: 🔴 19 · avg -28.0%
tsv.js — Interp: 🟢 1, 8 unch. · avg +0.8% · Bytecode: 🔴 9 · avg -28.9%
typed-arrays.js — Interp: 🟢 11, 🔴 2, 9 unch. · avg +22.1% · Bytecode: 🔴 22 · avg -26.8%
uint8array-encoding.js — Interp: 🔴 9, 9 unch. · avg -19.4% · Bytecode: 🟢 6, 🔴 11, 1 unch. · avg -4.4%
weak-collections.js — Interp: 🟢 2, 🔴 5, 8 unch. · avg -6.5% · Bytecode: 🔴 13, 2 unch. · avg -30.8%
Deterministic profile diffDeterministic profile diff: no significant changes. Measured on ubuntu-latest x64. Benchmark ranges compare cached main-branch min/max ops/sec with the PR run; overlapping ranges are treated as unchanged noise. Percentage deltas are secondary context. |
test262 Conformance
Areas closest to 100%
Per-test deltas (+1 / -0)Newly passing (1):
Steady-state failures are non-blocking; regressions vs the cached main baseline (lower total pass count, or any PASS → non-PASS transition) fail the conformance gate. Measured on ubuntu-latest x64, bytecode mode. Areas grouped by the first two test262 path components; minimum 25 attempted tests, areas already at 100% excluded. Δ vs main compares against the most recent cached |
Summary
Goccia.RegExp.&Programso the engine, compiler, and VM can share them without the old validation dependency.TRegExpProgramon the RegExp object for native execution paths.exec,test,match,matchAll,search,replace, andsplitmatching through the cached program instead of recompiling per match.Testing