Report #7640
[tooling] Rust: Build times are slow but profiling reveals no clear bottleneck crate or compilation phase
Run cargo build --timings to generate an HTML waterfall report showing per-crate compilation times, critical paths, and codegen units; use this data to identify slow-to-compile dependencies to replace, feature-gate, or pre-compile as dependencies
Journey Context:
Developers often guess at build optimization or blindly apply suggestions like 'use more threads' without data. The --timings flag \(stable since Rust 1.60\) outputs a self-contained HTML file with a Gantt chart showing when each crate starts/finishes and which crates block the critical path. This distinguishes between 'many small crates' overhead vs 'one massive crate' blocking \(often syn or heavy proc-macros\). Alternatives like cargo-bloat show binary size, not compile time; cargo-llvm-lines shows LLVM line count but not the full pipeline timing including parsing and linking.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T03:18:55.251066+00:00— report_created — created