Skip to content

perf(jsc): cache repeated stack source coordinates - #8

Merged
steipete merged 5 commits into
openclaw/mainfrom
steipete/w161-engine-overheads
Oct 5, 2026
Merged

steipete merged 5 commits into
openclaw/mainfrom
steipete/w161-engine-overheads

Conversation

@steipete

@steipete steipete commented Oct 5, 2026 •

Copy link
Copy Markdown

Repeated stack reads recomputed syntax-selected line/column positions through the provider's compressed line table. Cache only requested provider-relative coordinates under its existing lock, preserving document offsets, builtin reader policy and persistent bytecode format. This builds on the source-position support in #3. Regression coverage includes independent providers, UTF-16 columns, line-table boundaries and repeated reads.

On one dedicated AWS Linux host, eight-sample ABBA against merged main 6fceea99 measures the original exception workload at 216.787 → 213.630 ms (−1.46%) and capture-plus-format at 110.309 → 106.124 ms (−3.79%). Matching Node 24 comparisons put the final runtime at 213.749 versus 1204.339 ms for exceptions and 106.522 versus 504.616 ms for capture-plus-format. Cold OpenClaw error-file and real buffer-custody worker comparisons are near flat; worker elapsed time is dominated by transformation/compilation.

The accounting experiment against #5 was rejected. Its variants passed functional tests, but the tiny-array gain remained noisy and deferral slowed the first exact snapshot after 65,536 fresh views from 0.0132 ms to 0.1427 ms. All accounting source/tests are byte-identical to merged main. The final runtime restores the 0.0136 ms first-snapshot result. Allocation controls are noisy (the final tiny-array median changed from +2.22% to −3.49% in a targeted identical repeat); no accounting improvement is claimed.

Qualification of exact head 64b0148f17cad0a27dd2899c39f9c133d5a98945:

  • Thirty direct JSC fixture/tier runs, 138 stack stress configurations, live readers, owned/persistent caches and runtime-cache replay pass.
  • All 24 accounting modes pass, including busy and parked worker snapshots. Process/worker/native-buffer/resource-limit/serializer suites pass 19/7/1/14/60 tests.
  • All 343 CallSite/util/source-map tests, 68 minifier tests, 30+56 Node coordinate observations and seven recorded JS/TS/module/async corpora pass or preserve the existing explicit policy.
  • All 47 fork-selection results match the all-pass merged baseline; the full real worker pool passes 21 tests and unchanged accounting consumers pass 38.
  • Scoped ThreadSanitizer passes accounting and 20 VM lifetimes (1,280 inspections plus 1,280 cancellations), using the unchanged pre-existing GC exceptions. A separate shared-cache probe passes 40,000 lookups across eight threads, including zero and the maximum unsigned offset, with no sanitizer report or suppression. This is not an unsuppressed collector-wide race-free claim.
  • The committed candidate is scoped-clean through P2. Actionlint, 14 release-integrity tests and four result-verifier tests pass.

Both exact-head lanes passed in run 37261336685: native Linux qualification and macOS arm64 artifact compilation on Linux. The sparse CI checkouts fetch complete history for fixed-base provenance. Permissions remain read-only; publication workflows and upstream recipes are unchanged. The macOS lane is compilation proof, not native macOS runtime proof. Engine and Bun must be rebuilt together. No artifact publication or Bun manifest update is included.

@steipete steipete changed the title perf(jsc): reduce stack lookup and typed-array accounting work perf(jsc): cache repeated stack source coordinates Oct 5, 2026
@steipete
steipete marked this pull request as ready for review October 5, 2026 04:54
@steipete
steipete merged commit 54b0b3a into openclaw/main Oct 5, 2026
3 checks passed
steipete added a commit that referenced this pull request Oct 5, 2026
Carry #8 to the rebased release with byte-identical engine and regression patches. Preserve the complete protected publication path and prior release qualification; compose only CI/documentation overlaps.

Require the new coordinate regression across seven direct stack modes, the original error-stack stress selection and cache replay. Exact-head CI run 37282530932 passes Linux qualification and macOS arm64 cross-compilation; P2 review is scoped-clean. Qualification includes 1,778 stress/1,639 module configurations, 138 stack configurations, 46/46 paired rows, 85/85 sync rows, 343 stack and 68 minifier tests, compatibility startup/memory gates and the 100-assertion idle-inspection interaction.
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.

1 participant