What this thread does
Use Cargo's timing report to pick a build-time change, and measure binary bytes separately before changing the release profile.
Do first: run cargo build --timings for the build that feels slow and open target/cargo-timings/cargo-timing.html; is the delay in dependency compilation or your final crate? The report includes compiler version, units and the dependency critical path. Timing report.
As of November 2026, every branch targets Rust/Cargo 1.99. Reference date: 2026-11-08. The 2026-10-01 Cargo changelog records the version line; these are profile choices, not promised speedups.
Choose the matching branch
1. You only need compiler feedback while editing — Cargo 1.99. Use cargo check instead of building an executable after every edit. It skips final code generation. Confirmation: compare the time to diagnostics after the same small edit; keep a full build before shipping because some errors appear only during code generation. cargo check.
2. Slow dependencies dominate — Cargo 1.99. Run cargo tree -e features and cargo tree --duplicates. Identify one expensive dependency's enabled features; disable an unnecessary default with default-features = false and explicitly retain the features your application uses. Confirmation: rebuild with --timings, inspect the enabled-feature list and run the application's affected path; feature unification may keep a feature enabled through another dependency. Timings guidance, feature graph, dependency features.
3. The shipped executable is large — Cargo 1.99. First record the release executable's byte count with your file manager. Add strip = "symbols" under the workspace root's [profile.release] and rebuild with cargo build --release. Confirmation: compare bytes on the same target and run a representative command. Stripping trades diagnostic symbol information for size; retain a separate unstripped artifact when needed. strip and its rustc behavior, compiler stripping options.
4. Stripping is insufficient — Cargo 1.99. Try opt-level = "s", then separately "z" under [profile.release]. Rebuild and record bytes plus a representative runtime for each candidate; keep the smaller acceptable result. Confirmation is the actual artifact and workload: Cargo explicitly warns that these options need not produce the smallest output. "z" also disables loop vectorization. size optimization settings.
5. Release linking is slow after aggressive optimization — Cargo 1.99. If your manifest sets lto = true and codegen-units = 1, compare lto = "thin" and then lto = "off", changing one setting at a time. Keep shipping settings separate from [profile.dev], whose default includes incremental compilation outside CI. Confirmation: compare equivalent clean builds in separate disposable target directories, artifact bytes and runtime; don't compare a warm build with a cold one. LTO and codegen units.
Evidence and limits
Nagisa's 2018-01-25 compiler report #47745 documents workloads where ThinLTO plus multiple codegen units gave worse generated code. It supports measuring the tradeoff; it does not establish a Rust 1.99 regression. Cargo's timings describe compilation units rather than all compiler-internal parallelism. No profile combination guarantees faster builds, smaller bytes and faster runtime together. Timing limits.
Not for: GitHub Actions Rust build caching.
Started from a post by @nagisa, packaged by the editor. Original post