Release 0.4.3: interactive-editing perf (19% median, 26% p95)#31
Conversation
|
Caution Review failedPull request was closed or merged during review 📝 WalkthroughWalkthroughThis PR releases version 0.4.3, replacing SourceSpan's internal representation from two SourceLocation references to six primitive integers (startLine, startColumn, startOffset, endLine, endColumn, endOffset), with new convenience accessors. All dependent code paths across tests, incremental parser internals, playground, and diagnostics are updated to use the simplified accessor API. A new IncrementalSessionBench benchmarking tool is added. ChangesSourceSpan Data Structure & Accessor Migration
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ast-grep (0.42.1)peglib-core/src/main/java/org/pragmatica/peg/generator/ParserGenerator.javaComment |
Summary
Performance release focused on interactive editing. Measured on the IncrementalBenchmark editing-session suite over a 1,900-line Java fixture:
Breaking change
SourceSpannow stores int triples instead of twoSourceLocationrefs. Component accessors are nowstartLine()/startColumn()/startOffset()/endLine()/endColumn()/endOffset(). The legacystart()/end()methods remain (lazy SourceLocation materialization). FactorySourceSpan.sourceSpan(SourceLocation, SourceLocation)is preserved. Pattern-matching code that destructuresSourceSpan(SourceLocation, SourceLocation)must migrate to eithercase SourceSpan span+ accessors orcase SourceSpan(int, int, int, int, int, int). Drove the p95 win.Internals
NodeIndex.buildpre-sizes the IdentityHashMap from a descendant-count pass (eliminates resize churn — was 22.8% of bench allocations). (Commitfcff78f)IncrementalSessionBenchinpeglib-incremental/src/jmh/java: realistic 1,000-edit interactive sessions, Regimes A (cursor-pinned) and B (cursor-moved-to-edit). Per-class median/p95/p99/max + frame-budget hit rate + top-10 outlier diagnostics. JVM tuning recommendations inpeglib-incremental/README.md(-Xms2g -Xmx2g -XX:MaxGCPauseMillis=20reduces p99 by 33%). (Commits716a113,77c7c70)Notes for downstream
docs/incremental/ARCHITECTURE-0.5.0.mdwhen published).Test plan
mvn install— BUILD SUCCESS (jbct format check passes afterchore: jbct:format pass on SourceSpan)mvn test— 897 tests passing across 5 modules (699 + 100 + 66 + 5 + 27), 0 failures, 0 errors, 0 skippedSummary by CodeRabbit
BREAKING CHANGES
New Features
Performance
Documentation