Repository navigation
Reduce release build time and binary size - #1449
John-David Dalton (jdalton) wants to merge 1 commit into
Conversation
Use one codegen unit for release builds based on repeated hosted build measurements. Preserve the existing effective setting for inherited profiles. Assisted-by: Codex: GPT-6
|
Final reviewer: I turned auto-merge off on Generated by Claude Code |
|
Ready for review (burn-down agent)
Generated by Claude Code |
Final review briefWhat it does: Sets Risk: low. One file, four added lines, build config only. The only thing that changes is how the shipped binary is compiled ( Look here:
Verified: read the full diff. Checked that no other profile inherits Changes I made: none. Open questions: none blocking. The PR description's "CI" section still says Auto-merge (squash) is armed, so approving sends this straight to the merge queue. Generated by Claude Code |
LLM Description written by Codex: GPT-6
User impact
Release builds can complete faster and produce a smaller CLI binary. The repeated hosted measurement on Rust 1.93.1 reported median build times of 350.780s with the default settings and 333.036s with one codegen unit, a 5.06% ratio-of-medians reduction. The measured binary was 16.27% smaller.
Change
Set
[profile.release]to one codegen unit. Setci-release,perf, andaddonexplicitly to 16 to preserve their current inherited configuration.Evidence and limits
The repeated hosted run is here. It used Ubuntu 24.04 x86_64 and Rust 1.93.1. Its source revision predates the current main source tree; current main has changed Rust code since the measurement, so exact build-time and size results may differ. This measurement does not claim runtime improvement or results for other release platforms.
Exact-head validation
On macOS 27 arm64 with Rust 1.93.1 and clean, separate targets, the candidate release build completed in 210.836s versus 220.474s for the same commit with a codegen-units=16 override. Compiler invocations confirmed codegen-units 1 and 16 respectively. This is one pair (4.37% faster in that pair), not repeated performance evidence. Binary sizes were 18,978,624 versus 22,864,448 bytes (17.0% smaller).
--versionand--helpoutput matched. The release-mode golden tests passed: 1 redirect fixture test and 2 SBT golden tests.CI
The CI run 38307581268 has
ci-okfailing because one Cargo fixture test could not connect tostatic.crates.ioto downloadcfg-if; 38 tests in that job passed and one failed on the download. The failure log is here. The change does not modify Cargo.lock or dependency configuration.Note
Low Risk
Build-profile-only change with no runtime logic; main risk is longer release compile times or different optimization on non-overridden profiles if inheritance is misconfigured.
Overview
Tunes Rust release builds by setting
codegen-units = 1on[profile.release], aiming for a smaller shipped CLI and modestly faster release links (per hosted benchmarks in the PR description).Because
ci-release,perf, andaddoninheritrelease, the PR pinscodegen-units = 16on those profiles so CI test shards, perf/bench builds, and the Node addon keep faster parallel codegen and do not pick up the single-unit release setting.Reviewed by Cursor Bugbot for commit a51923e. Configure here.
Generated by Claude Code