Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ jobs:
curl -sSfL --retry 5 --retry-all-errors -o "$RUNNER_TEMP/trunk.tar.gz" https://github.com/trunk-rs/trunk/releases/download/v0.21.14/trunk-x86_64-unknown-linux-gnu.tar.gz
echo "f2b4680cd239693a646a2795e4633c625328d7b2a044fbe749fa3a2fe9e7036b $RUNNER_TEMP/trunk.tar.gz" | sha256sum -c -
mkdir -p "$RUNNER_TEMP/bin" && tar xzf "$RUNNER_TEMP/trunk.tar.gz" -C "$RUNNER_TEMP/bin" trunk
# The page names the release profile (`web`, fat LTO: a quarter of an hour), which would
# The page names the release profile (`web`, about ten minutes), which would
# outrank --cargo-profile; this throwaway checkout drops it to package the dev build.
sed -i 's/ data-cargo-profile="web"//' apps/rustgis-web/index.html
if grep -q 'data-cargo-profile=' apps/rustgis-web/index.html; then echo "::error::apps/rustgis-web/index.html still names a Cargo profile" >&2; exit 1; fi
Expand Down
8 changes: 3 additions & 5 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -188,10 +188,8 @@ opt-level = 3
lto = "thin"
codegen-units = 16

# The web app's build (Trunk, `data-cargo-profile` in apps/rustgis-web/index.html): whole-program
# 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%

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed, the figures will age; the PR keeps them. Left for the release quality pass.

# smaller, but took 15.5 GB at its peak (2.7 GB this way) and lost CI's 16 GB runners partway.
[profile.web]
inherits = "release"
lto = "fat"
codegen-units = 1
Loading