Practical techniques for 2-4x faster development builds
Published December 21, 2025
Rust compilation is notoriously slow. The bottleneck lies in two distinct stages:
To identify which stage is your constraint, run cargo check. If it's sluggish, the frontend is your bottleneck. If checks run quickly but builds lag, the backend needs attention.
The backend offers several practical speedup opportunities:
Cranelift is an alternative compiler backend that prioritizes compilation speed over output quality. It delivers approximately 2x faster code generation for development builds, though with slower runtime performance.
Installation:
rustup component add rustc-codegen-cranelift-preview --toolchain nightly
export CARGO_PROFILE_DEV_CODEGEN_BACKEND=cranelift
Best practice: Use Cranelift for development iterations, ship with LLVM for production.
A faster replacement for the default linker, achieving 2-5x linking speedups.
Configuration in .cargo/config.toml:
[target.x86_64-unknown-linux-gnu]
linker = "clang"
rustflags = ["-C", "link-arg=-fuse-ld=mold"]
A compiler output caching tool that improves rebuild performance by storing compilation results on disk. Particularly valuable for CI pipelines.
Note: The OS page cache already keeps hot entries in RAM automatically, so local development gains may be modest.
Optimize your development profile for speed in Cargo.toml:
[profile.dev]
opt-level = 0 # No optimization
debug = false # Disable debug symbols
incremental = true # Enable incremental compilation
codegen-units = 256 # Enhanced parallelism
There's no quick fix for frontend speed. Parallel frontend compilation is years away. The practical mitigations:
Rust prioritized safety and zero-cost abstractions over compile speed. Go made the opposite choice: compilation-first design with file-level parallelism, simpler grammar, and custom compiler infrastructure. These are fundamentally different design philosophies.
Using Cranelift, mold, sccache, and an aggressive dev profile together typically achieves 2-4x faster development builds. This is realistic expectation — not a magical 10x improvement.
Cranelift produces faster compile times but significantly slower runtime performance. Never ship Cranelift-compiled binaries to production. This is a development-only optimization.
The frontend bottleneck has no quick technical fix. The only solution is architectural: write less code, minimize dependencies, avoid heavy macros. The backend bottleneck has proven tools that deliver real speedups.