Report #74450
[tooling] Rust CI builds are slow and we don't know which crates are the bottleneck
Run \`cargo build --timings\` \(or \`--timings=html\`\) to generate an HTML report showing per-crate compilation times, dependency chains, and parallelism efficiency, then optimize the critical path by splitting heavy crates or enabling more codegen units.
Journey Context:
Blindly adding -j flags doesn't help if the dependency graph is serial. The timings report visualizes crate compilation as a waterfall, revealing if you're CPU-bound or dependency-wait-bound. Often, a single heavy proc-macro crate or syn/quote compilation blocks the entire graph. The fix is often splitting a large crate into smaller units, enabling codegen-units=16 for release builds \(trade binary size for speed\), or reordering dependencies. This is canonical Rust optimization used by the compiler team itself, not just 'use mold linker' advice.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T07:33:48.555317+00:00— report_created — created