DEVELOPMENT & DEVOPS · AGENT SKILLS DIRECTORY

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:

  1. Diagnose bottlenecks: run cargo build --timings (inspecting cargo-timing.html for sequential chains, >10s crates, and blocking proc-macros) alongside cargo llvm-lines --release | head -20 for monomorphization bloat.
  2. Enable sccache: configure rustc-wrapper = "sccache" in .cargo/config.toml and S3/GitHub Actions (mozilla-actions/sccache-action) caching for CI.
  3. Cranelift dev backend: install rustc-codegen-cranelift-preview on nightly and enable codegen-backend = "cranelift" only under [profile.dev] while keeping LLVM for release builds.
  4. 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.
  5. Tune LTO profiles: keep lto = "off" with codegen-units = 16 in dev; use lto = "thin" for standard releases and reserve lto = "fat" plus codegen-units = 1 for latency-critical release builds.
  6. Switch to faster linkers: configure mold (-C link-arg=-fuse-ld=mold on Linux), lld, cargo-zigbuild, or zld on macOS.
  7. Quick profile wins: set debug = 1 (line tables only) and split-debuginfo = "unpacked" in [profile.dev], test CARGO_INCREMENTAL=0 on full rebuilds, and pin heavy proc-macro dependencies (serde, tokio, axum).

Primary sources