Repository navigation
perf(octane): inline fixed-arity snapshot clones - #1971
Conversation
Benchmark report
Compares js-framework: 1k/10k row operationsAll 20 timed operations (20 without a verdict)
Work counters (an increase fails this check):
58 other measured values are unchanged. Application bundle size (bytes)
9 other measured values are unchanged. Public-import reachability bundles (bytes)
42 other measured values are unchanged. |
|
Good to go. Two non-blocking notes, nothing to fix before merge.
Verified:
|
|
Clarified the source comment in 14e7c9e: per-arity cloning remains monomorphic only when the downstream minifier preserves the separate spread sites. The optional arity-16/default cleanup is deferred, so the measured executable code remains unchanged. Sync and scoped formatting pass; the signed base integration is 329f5bc, with all 30 current-head checks passing. |
Summary
Inline each fixed-arity binding snapshot into its existing dispatcher arm, removing 17 private wrapper functions while preserving a separate object-spread site for every arity and the unchanged default. A fixed snapshot now makes one fewer helper call; its copied values, object allocation, journal window and rollback behavior are unchanged.
Matched complete-production-JavaScript gzip bytes against fixed base
4cc2a1ed, with Node 24.20.0:Rows raw output drops 476 bytes in both minifiers. All six emitted dispatchers preserve 18 distinct spread sites. These are measured standalone totals; broader composed-bundle probes are not added to them.
Why
The wrappers exist to keep the spread feedback for distinct bag arities separate. Distinct dispatcher arms preserve those sites without retaining separate wrapper functions. This is a small bundle reduction, not completion of the wider bundle target.
Changes
Validation
pnpm format:check— authored-file formatting and current-head CI lint/format checks pass.pnpm typecheck— runtime/index scoped typechecks pass without diagnostics; full current-head CI typechecks also pass.pnpm test— all four Node 24 test shards and aggregate gate pass on current head; React parity, Chromium integration, package validation and example builds also pass.perf-review: mechanical scan reports zero candidates. One shallow object allocation and one spread site per arity remain; the existing arity switch and journal publication order are unchanged. The mixed-shape owning work and timings below qualify this boundary change with finite uncertainty.concise-code: runtime +19/−36; removes 17 private functions, adds no module/export/type/option/field. A single shared spread would lose the existing arity-specific feedback and is not used. The only new file is the patch changeset.pnpm syncpassed before signed publication; all 255 frozen package files remain unchanged.Risk / follow-ups
The owning browser timing uses Node 24.20.0, bundled Chromium 149.0.7827.55 and clean production esbuild artifacts. Each operation has 16 independent fresh browser-process groups per actual and identical-baseline cohort, 10 warmup and 12 retained pairs per group, balanced order and group arithmetic means as the primary bootstrap unit. All 64 groups and 1,408 pairs are retained, with no errors or exclusions.
No slowdown was detected in these prespecified warmed workloads; the primary intervals permit up to +1.91% and+0.41%. Actual held-request resolution and retry correctness are verified outside the timer. First affected calls are recorded separately and less precise, with candidate upper bounds +3.45%/+6.58%. An identical-update execution-order partition is positive (1.0329 [1.0100, 1.0452]); it is retained without normalizing candidate results. These measurements do not establish a speedup, universal parity or tail latency. Independent final evidence review is clean.
The current-head CI benchmark report confirms the rows/JSX reductions and all 64 work-counter results above. Its synthetic merge
dd39d85cchas the exact same Git tree as published headee6ee4749. Other complete-bundle gzip changes are Todo −113 B, chat −129 B, weather −111 B and bindings −57 B.CI labels all 20 timings within its ±3% verdict threshold, but two 95% intervals are strictly positive: TSRX clear +2.6% [+1.4%, +3.9%] and JSX large-list selection +1.3% [+0.3%, +3.8%]. These observations remain recorded; the direct mixed-arity snapshot measurements do not establish universal ordinary-row neutrality. One prespecified local follow-up measured TSRX clear only. JSX large-list selection remains a separate, unconfirmed CI observation; no broad CI or benchmark rerun was performed.
The clear follow-up reuses the exact ordinary esbuild artifacts and original 10,000-row prepare/clear operation with one click per window. It retains 12 independent fresh browser-process groups per actual and identical-baseline cohort, six warmup and ten retained pairs per group, plus a separate first-clear pair. All 24 groups, 384 warmup/retained pairs and 24 first-clear pairs are preserved, with balanced order, matching serialized inputs, empty-table checks and no retained deleted-node arrays. All 843 source/config pins and eight artifacts, styles/clocks and error gates pass; independent review reproduced the statistics.
No statistically resolved slowdown was detected in this local fresh-clear cohort: candidate/baseline 1.0054 [0.9930, 1.0227], identical-code control 1.0016 [0.9891, 1.0235]. The candidate interval permits +2.27% and overlaps part of the original CI interval; it does not disprove that observation or prove unchanged performance. First-clear uncertainty is broader, permitting +4.62%. Retained clears take 19.24–33.94 ms without timing-based repetition or exclusions. This is a fresh-operation host/history, not a replay of the complete preceding CI sequence. Both original CI observations and the owning cold/order limitations remain disclosed.
Current head
ee6ee4749has green CI and no open review threads. Independent source and local evidence review are complete for this focused scope with the uncertainty above; maintainer approval remains required. No merge is requested.Provenance
agent-authored)Codex task · implementation subtask
duplication_audit· hostcom-79386.Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.Note
Low Risk
Mechanical refactor inside private runtime cloning; extensive regression and bundle-size checks reported, with no public API changes.
Overview
Shrinks the Octane production bundle by removing seventeen private
cloneBagNhelpers and inlining{ ...bag }in eachcloneBindingBagswitch arm.Behavior is unchanged: every arity (including default) still has its own object-spread site for monomorphic cloning, and binding snapshot copy / journal rollback semantics stay the same. An Octane patch changeset documents the size win.
Reviewed by Cursor Bugbot for commit 329f5bc. Bugbot is set up for automated code reviews on this repo. Configure here.