Rust Build Times
The rust-build-times skill in mohitmishra786/low-level-dev-skills equips AI coding agents with a 7-step playbook for diagnosing and accelerating slow Rust compilation—combining cargo build --timings and cargo-llvm-lines profiling with sccache, nightly Cranelift dev codegen, workspace crate splitting, Thin LTO trade-offs, and fast linkers (mold, lld, cargo-zigbuild).
Explore the workflow and limits ↓What to use it for
Use the rust-build-times skill when Cargo workspaces suffer from long incremental rebuilds, proc-macro bottlenecks, slow link phases, or uncached CI pipelines.
At commit d0d0a13, mohitmishra786/low-level-dev-skills organizes 142 systems-programming skills across Rust, C/C++, Zig, embedded firmware, and Linux observability. skills/rust/rust-build-times/SKILL.md activates on queries about cargo-timings, sccache, Cranelift, workspace splitting, Thin vs. Fat LTO, and mold.
Good fit: Rust teams tuning local edit-compile cycles and CI build caches across multi-crate workspaces. Choose another tool if you primarily need C/C++ build acceleration (build-acceleration) or runtime CPU flamegraphs (rust-profiling).
Installation
Install just rust-build-times or the broader Rust bundle via the Skills CLI:
npx skills add mohitmishra786/low-level-dev-skills --skill rust-build-times
To add the full 12-skill Rust bundle (rustc-basics, cargo-workflows, rust-debugging, rust-profiling, rust-ffi, rust-cross, rust-sanitizers-miri, rust-unsafe, rust-async-internals, rust-security, rust-no-std, rust-build-times):
npx skills add mohitmishra786/low-level-dev-skills --skill rustc-basics cargo-workflows rust-debugging rust-profiling rust-ffi rust-cross rust-sanitizers-miri rust-unsafe rust-async-internals rust-security rust-no-std rust-build-times
Pass --all --global if you want all 142 systems skills available across repositories.
7-step Rust compilation playbook
The rust-build-times specification walks agents through seven measurable steps before rewriting application code:
- Diagnose bottlenecks: run
cargo build --timings(inspectingcargo-timing.htmlfor sequential chains, >10s crates, and blocking proc-macros) alongsidecargo llvm-lines --release | head -20for monomorphization bloat. - Enable
sccache: configurerustc-wrapper = "sccache"in.cargo/config.tomland S3/GitHub Actions (mozilla-actions/sccache-action) caching for CI. - Cranelift dev backend: install
rustc-codegen-cranelift-previewon nightly and enablecodegen-backend = "cranelift"only under[profile.dev]while keeping LLVM for release builds. - Split monolithic crates: break circular dependencies, isolate proc-macros in their own crate, and split unrelated subsystems (
core,networking,ui,server,cli) for parallel Cargo compilation. - Tune LTO profiles: keep
lto = "off"withcodegen-units = 16in dev; uselto = "thin"for standard releases and reservelto = "fat"pluscodegen-units = 1for latency-critical release builds. - Switch to faster linkers: configure
mold(-C link-arg=-fuse-ld=moldon Linux),lld,cargo-zigbuild, orzldon macOS. - Quick profile wins: set
debug = 1(line tables only) andsplit-debuginfo = "unpacked"in[profile.dev], testCARGO_INCREMENTAL=0on full rebuilds, and pin heavy proc-macro dependencies (serde,tokio,axum).