This repository was archived by the owner on Oct 20, 2026. It is now read-only.
Repository navigation
web-render: ship the engine wasm with fat LTO (−1.7 MB); 9 MiB size gate; 0.1.0-canary.18 - #8
Merged
Merged
Conversation
…-canary.18 The engine wasm was built with cargo's default release profile: no cross-crate LTO and 16 codegen units. A `wasm-release` profile (release, lto = "fat", codegen-units = 1) used by scripts/build-wasm.sh and scripts/build-wasm-perf.sh takes blitz_web_bg.wasm from 10 723 939 to 9 016 823 bytes (-1 707 116, -15.9%; brotli 2 612 273 -> 2 496 172), built with the CI pins (Rust 1.93.0, wasm-bindgen 0.2.125, binaryen 119, wasm-opt -Oz unchanged). The native tests and benches keep their profiles. No slowdown: the five perf workloads, timed in node against both wasm builds in alternating rounds, run 0-6% faster, and every workload's JSON output is byte-identical between the two builds. The size gate now reads its ceiling from the manifest's maxBytes for the blitz wasm, lowered from 64 MiB to 9 MiB (9 437 184), so growth past the current size plus ~4.7% fails the build. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
status.md gets an "Engine size" section: 9 015 481 bytes as CI builds it (2 497 009 brotli), against 10 723 633 for the published canary.17 wasm, and the 9 MiB manifest gate. The perf record gets the size and wall-clock comparison of the release and wasm-release builds. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Shrinks the paged.web engine wasm (
bin/blitz_web_bg.wasm) by 1.7 MB with a dedicated build profile, and tightens its size gate so growth is caught.What changes
packages/web-render/Cargo.toml: a[profile.wasm-release]profile (inherits = "release",lto = "fat",codegen-units = 1). The default release profile has no cross-crate LTO and 16 codegen units. Native tests and benches keep their profiles.scripts/build-wasm.shandscripts/build-wasm-perf.shbuild with--profile wasm-release.wasm-opt -Ozstays.build-wasm.shnow reads its ceiling from the manifest'scapabilities.wasm[blitz].maxBytes, so the two can't drift. That value drops from 64 MiB to 9 MiB (9 437 184 bytes), about 4.7% above the new size.@paged-media/webgoes to 0.1.0-canary.18. The engine sources changed (Cargo.toml) and so did the manifest, sopackage-hash.mjs --checkneeds the bump. Merging publishes canary.18.architecture.mdand the ADR 308 row indocs/README.mdnow give the new ceiling.status.mdand the perf record get the measured sizes.Size
Built the way the publish workflow builds it:
build-wasm.sh --enginewith Rust 1.93.0, wasm-bindgen 0.2.125 (from Cargo.lock) and binaryen 119.wasm-release)Built in CI for this PR (the vitest job): 9 015 481 bytes (brotli 2 497 009). The published 0.1.0-canary.17 wasm is 10 723 633 bytes, so CI to CI the difference is −1 708 152 bytes. Local and CI builds differ only by a few hundred bytes of embedded build paths.
No slowdown
I timed the five perf workloads from
tests/common/workloads.rsin node against both wasm builds through the exported entries. Each run did 10 alternating rounds of 40 iterations per workload on one machine, and the table gives the median of the round medians:For every workload, the JSON output of the two builds is byte-identical.
test/perf/perf-budgets.spec.tswithPERF_SHOW=1(3 interleaved runs each) gives the same door, wasm-call and byte counts for both builds, and its wall-clock stays within noise.Tests
REQUIRE_REAL_ENGINE=1 pnpm -r exec vitest runagainst the new wasm: web-bundle 339/339, web-conformance 103/103, web-model 290 passed (the 9 corpus-dependent tests skip, as in CI). Contract-import lint and typecheck are clean.cargo fmt --check, clippy-D warningsfor all three feature sets,cargo test --features blitz,cargo testand theperf_budgetscount budgets all pass.🤖 Generated with Claude Code