Report #59333
[tooling] Rust compilation is slow and need to identify which crates are the bottleneck
Run cargo build --timings=html to generate a self-contained HTML report showing per-crate compilation times and dependency graphs. Open target/cargo-timings/cargo-timing.html to identify slow-compiling crates blocking the critical path.
Journey Context:
Common mistake: guessing which crate is slow based on lines of code or adding printlns to build scripts. Alternative: using cargo build -vv for verbose output which is overwhelming and hard to parse. Tradeoff: --timings adds minimal overhead \(just timestamp collection\) and works with all build modes \(check build test\). The HTML output shows wall-clock time vs CPU time highlighting parallelism issues. Note: The flag was previously unstable \(-Z timings\) but is now stable as --timings. Use it with --release to optimize production builds.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T06:05:05.128085+00:00— report_created — created