Repository navigation
perf: avoid cause-free Error serialization overhead - #194
Merged
Merged
Conversation
Retain terminal v14 Error records and snapshot own data causes for a distinct v16 tag. Negotiate v16 support separately from the intermediate v15 format so older IPC peers continue receiving v14 messages.
steipete
marked this pull request as ready for review
October 20, 2026 17:58
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
This was referenced Oct 20, 2026
steipete
added a commit
that referenced
this pull request
Oct 24, 2026
…ral design (#196) This reverts b40c6ae (#194), then cb98044 (#192), using git revert. The pooled median Worker session-message ratio across three machines was 1.078019079 against the predeclared maximum 1.05. Restore the S3 v14 wire format and Error cause omission pending a performance-neutral design. Keep #195's pending-container-terminator reservation unchanged. The source tree differs from S3 only by that serializer patch and the changelog.
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.
Cause-free
Errorserialization now keeps the terminal fast path and exact v14 record layout, while preserving theError.causesemantics added in #192.Design
Only an Error with an own data
causeuses the newErrorInstanceWithCauseTagand nonterminal graph traversal. Its cause is captured and rooted before metadata getters run, and object pooling preserves aliases and self-cycles. Ordinary own properties use JSC's direct storage and attributes; unusual native/custom property cases retain descriptor lookup. Serialization never restarts or replays getters.The first cause-bearing record patches the fixed-width stream header to v16 without moving bytes. Cause-free graphs remain byte-identical v14, with no presence bytes, offset bookkeeping, or compaction. Readers accept formats through v14 and v16; they reject v15, an unreleased intermediate layout. Advanced IPC advertises a new v16 capability bit, separate from #192's v15 bit. Peers advertising only the old bit, or no bit, receive v14 with causes omitted.
Performance and attribution
The unchanged payload benchmark used ten alternating pairs and optimized Linux x64 builds. S3 is
ef37c31de3, #192 main iscb98044b7d, and this change is5af8df187. Error payloads contain one Error without a cause: 273 serialized bytes, or 307 bytes with the message wrapper. Worker timings are amortized send/drain costs, not synchronous call latency.Absolute medians from the later control:
Ratios are medians of paired ratios; absolute values are separate medians, so their quotient need not equal the paired ratio. The original gate and later control are distinct runs. The first qualification still exceeded the 1.01 target and the 1.03 Worker gate; neither run passed every per-case gate, and the limits were not relaxed or reported as passing. This residual cost is accepted as a documented tradeoff for Node-parity
Error.causesemantics.The original profiles identified duplicate terminal/StateUnknown dispatch and descriptor work; compaction accounted for only a negligible sampled share. Ablation showed that removing cause support alone did not recover clone performance, while restoring S3's source-level Error metadata writer did. The Worker residual was not isolated to a single function. Ordinary Worker messages do not enable the transport Buffer envelope or execute the uncaught-worker Error metadata path. A separate cause-bearing ten-pair comparison measured 0.990× main for cloning and 1.025× for messaging (informational).
On Apple silicon, three interleaved native-arm64 spot checks with matched no-LTO builds showed Error-clone medians at parity with S3 (2.479 µs S3; 2.475 µs candidate) and no observed Error Worker regression (3.578 µs S3; 2.562 µs candidate). Candidate medians also remained ahead of Node 26.12.0 (2.495 µs clone; 3.111 µs Worker). This host was noisy, so these checks support parity rather than a precise speedup claim.
Compatibility and validation
worker-entry-point.test.tsexpected a builtin-entry-point error but receivedModuleNotFoundfor#fs. This existing baseline failure is retained, not reported as green.5af8df187.Upstream: oven-sh#31525 addresses Error cause preservation; this builds on #192 while retaining the v14 terminal path and introducing independent v16 negotiation.