Repository navigation
ci(web): build the web app with thin LTO, as native releases are built - #3590
Conversation
Whole-program LTO in one codegen unit took 15.5 GB at its peak, against the 16 GB of CI's runners, which lost the docs preview's build partway several times. Thin LTO takes 2.7 GB and about half the time; the download is about 5-8% larger.
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
| # LTO in one codegen unit makes the WebAssembly about a sixth smaller, a quicker download for | ||
| # the web app. Slower to build, so native releases keep thin LTO. | ||
| # The web app's build (Trunk, `data-cargo-profile` in apps/rustgis-web/index.html), as native | ||
| # releases are built: thin LTO. Whole-program LTO in one codegen unit made the download about 5–8% |
There was a problem hiding this comment.
Nit (not a defect): this comment hard-codes measurements (5–8%, 15.5 GB, 2.7 GB) taken on one machine, and they will go stale on the next dependency or code change. The trade-off itself is accurate per the PR table (gzip 26.4 → 28.4 MB, zstd 18.2 → 19.1 MB; uncompressed 87.1 → 104.6 MB), but the uncompressed size grows about 20%, and the comment only mentions the compressed download. Consider stating the reason and the trade-off once, without the figures, and pointing to the PR for numbers.
Category: quality
There was a problem hiding this comment.
Agreed, the figures will age; the PR keeps them. Left for the release quality pass.
Code reviewI found no bugs, security issues or AGENTS.md violations in this PR. It changes build configuration only: Bugs: none found. Nothing else in the repo depends on the web profile's fat LTO. I searched for other LTO or codegen-unit settings, wasm size budgets and profile references in Security: none. Performance: the trade-off is disclosed in the PR body, not a regression. The web bundle gets larger: compressed download +5–8% (gzip 26.4 → 28.4 MB, zstd 18.2 → 19.1 MB), uncompressed +20% (87.1 → 104.6 MB). The PR's "about 5–8%" wording in the Cargo.toml comment only covers the compressed size. The build peak drops from 15.5 GB to 2.7 GB, which is the reason for the change. Confidence: high that the numbers are as reported; the post- Quality:
AGENTS.md: no violations. Checked against "Reach every surface": the change affects only the web build, which the PR body states. "Size for real data" does not apply because no layer data is stored or copied. The Unverified: the PR says full CI passed in the fork. I could not check that, and I did not rebuild the wasm target or re-run the timing measurements. Earlier concerns: Change sizeCompared: the whole PR against main (merge base 5da4e06 to PR head 790433b).
|
📖 Docs preview
GitHub Pages takes a minute or two to publish a new commit. Newer commits from the fork aren't published until a maintainer adds the |
Summary
The web app's
webprofile used whole-program LTO in one codegen unit (#133). That build peaks at about 15.5 GB, against the 16 GB of a standard GitHub runner, and the docs preview's build lost its runner partway on several pull requests ("The hosted runner lost communication with the server", about 57 minutes in). Production deploys use the same build on the same runners, so they would start failing as the code grows. The profile now builds as native releases do, with thin LTO and 16 codegen units.Measured on this box at 5fe168d, the same build Trunk runs (
cargo build --locked --profile web --target wasm32-unknown-unknown -p rustgis-web), before Trunk'swasm-opt:Fat LTO in more codegen units takes more memory, not less, so it isn't an alternative. Under fat LTO, two branches that touch the readers (#3547, #3558) peaked within 0.1 GB of their bases, so the code didn't push it there; the build was at the edge already. Those sizes are before
wasm-opt. After it, as CI builds the app (this PR's docs preview against another's of the same hour, run 46811794643):On CI, the web app's build step took 16 min here, against 12–17 min for recent fat LTO builds; those reused a warm cache, which this profile change doesn't have yet, so the time saved on CI isn't shown here.
Surfaces: the web app's build only (Trunk, the docs preview, web deploys and releases). The desktop, command line, Python and phone builds are unchanged. No code changes.
Testing
UI evidence
No visible UI change.
Related issue
None. Found while gating #3547 and #3558 for #2761.
Summary by CodeRabbit