Repository navigation
ci(bench): guard the Rspack imported void-root bundle saving - #1841
Merged
Merged
Conversation
Add a codegen-size lane that builds the real Rspack adapter with the runtime bundled, in two variants from identical authored source: proven, and a control whose post loader routes the root's import through a re-export the adapter leaves unproven. Every other module must stay byte-identical and both variants must render the same DOM in jsdom. Ratio guards cover minified, gzip and Brotli for the #1839 hydrateRoot shape (gzip 52,075 / 86,560 = 0.60x) and a createRoot tree of four imported void components with an update (42,610 / 65,380 = 0.65x). Co-Authored-By: Claude Opus 5.5 <[email protected]>
trueadm
marked this pull request as ready for review
October 7, 2026 10:34
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
octane-website | 3433778 | Commit Preview URL Branch Preview URL |
Oct 07 2026, 10:48 AM |
Contributor
Benchmark report
Compares js-framework: 1k/10k row operations
All 20 timed operations (19 without a verdict)
All 64 work counters are unchanged. Application bundle size (bytes)No changes across 60 measured values. Public-import reachability bundles (bytes)No changes across 108 measured values. |
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
octane-website-mcp | 3433778 | Commit Preview URL Branch Preview URL |
Oct 07 2026, 10:51 AM |
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.
Summary
Follow-up to #1840, which lets Rspack production builds specialize an imported void root (#1839). The adapter tests guard that the specialization happens, but nothing guarded the bundle saving it exists for. This adds a lane to
benchmarks/codegen-sizeand six ratio guards for that saving.The new lane,
benchmarks/codegen-size/rspack-void-roots.mjs, builds the realOctaneRspackPluginin production mode with the runtime bundled. The saving is the generic returned-value renderer that the minifier can drop once the root is proven, so an externalized runtime can't show it. Each scenario is built twice from identical authored source and identical loaders:Each build asserts the following before its sizes are reported:
__createVoidRootor__hydrateVoidRootand no longer names the public factory. The control entry keeps the public factory and imports the re-export.hydrateadopts the server<p>in place.treechecks the mount, a keyed update through a secondroot.render, and unmount.jsdomis added to the suite through the catalog, withpnpm-lock.yamlupdated bypnpm install. The other 88 files arepnpm syncoutput: the lockfile hash recorded in each parity audit and in the evals manifest.Measurements
Measured under Node 24.18 and Rspack 2.1.4 on
mainat b8e55da. Bytes are deterministic: two runs were byte-identical.hydrate: the #1839 shape, onehydrateRootover an imported void leaftree:createRootover 4 imported void components, a keyed@for, and an updateThe
hydratepair matches #1840's issue measurement (86,370 → 51,880 gzip). Thetreepair saves less than #1840's nested-tree figure (63.4 → 33.7 KB) for two reasons:@forand an update, which pull the keyed list runtime into both variants.Guards
The guards are
maxRatiobounds on minified, gzip and brotli forrspack-void-{hydrate,tree}-provenagainst-control:hydrate: 0.70, 0.68 and 0.70.tree: 0.72, 0.73 and 0.74.That leaves about 0.08 of headroom for shared runtime growth, while still catching a specialized root that pulls half its saving back in.
Each guard was checked against a deliberate break, then reverted:
__createVoidRootuse the generic output handler (renderReturnedValue) takestreeto 1.00×, breaching all threetreeguards. The DOM check still passes, so only the guard catches this.__hydrateVoidRootuse it takeshydrateto 1.00×, breaching all threehydrateguards.installVoidComponentProofsfails the lane before measurement:hydrate: proven entry lacks __hydrateVoidRoot.Validation
pnpm format:check: not run in full.pnpm format:files:checkpasses on every authored file.pnpm typecheck: not run. No TypeScript project includesbenchmarks/codegen-size/*.mjs.pnpm test: not run. This change only touches the benchmark suite and the lockfile.node benchmarks/bench.mjs --quick --ratios codegen-sizechecks 40 guards. All six new guards pass.css-modules-client-proven/controlminified guard, below. It fails identically onmain.pnpm syncleaves the tree clean.Risk / follow-ups
main, the compiler-onlycss-modules-clientminified guard breaches at 2,294 / 2,582 = 0.888× againstmaxRatio0.84. It started with e233e4a (perf(octane): stop shipping the signal binding runtime in apps without signals #1762, which stopped shipping the signal binding runtime in apps without signals). Before that commit the pair was 3,183 / 3,890 = 0.818×. The weekly Bench workflow will report it until it is rebaselined or fixed. It is left to its own PR.codegen-size, about 5 s.hydrategzip guard, and about 19 KB fortree.Provenance
agent-authored)🤖 Generated with Claude Code
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.Note
Low Risk
Benchmark harness, ratio baselines, and lockfile/audit metadata only; no production compiler or adapter logic changes in this diff.
Overview
Adds codegen-size regression coverage for the Rspack adapter’s imported void-root specialization (follow-up to #1840): bundle size when the runtime is included and the minifier can drop the generic root renderer.
A new harness
rspack-void-roots.mjsbuilds proven vs control pairs forhydrate(singlehydrateRootover an imported void leaf) andtree(createRootover four void components with keyed@forand an update). The control reroutes the root import through a re-export the adapter does not prove; all other modules must match at seal. Both variants run in jsdom with identical DOM (and hydration adoption forhydrate).run.mjswires the new targets and logging;jsdomis added to the suite deps.baselines/ratios.jsongains six same-run maxRatio guards (minified/gzip/brotli × hydrate/tree).benchmarks/README.mddocuments therspack-void-*targets.Lockfile refresh from
jsdom:pnpm-lock.yamland the usualpnpm synclockfileSha256updates across parity audit JSON files.Reviewed by Cursor Bugbot for commit 3433778. Bugbot is set up for automated code reviews on this repo. Configure here.