cargo-slicer

Rust builds are slow. cargo-slicer makes them fast.

Two complementary techniques work together:

TechniqueWhat it doesTypical gain
Virtual SlicerStubs unreachable functions at the MIR level so LLVM never sees them1.2–1.5× per workspace
Warm-Cache DaemonPre-compiles registry crates once, serves cached .rlib files on every subsequent buildskips 100% of registry compilation

You do not need to understand the internals to use them. The all-in-one script runs the full pipeline in one command.

Real-World Results

Verified benchmarks (Apr 2026, host-native, no warm cache)

Both baseline and vslice-cc use identical RUSTFLAGS (-Z threads=8, wild linker). 2–3 runs per mode, 48-core machine.

ProjectBaselinevslice-ccSpeedup
helix (16 crates)68 s44 s1.55×
ripgrep (50K LOC)10.5 s7 s1.50×
zed (209 crates)1098 s767 s1.43×
zeroclaw (4 crates)686 s522 s1.31×
nushell (41 crates)103 s82 s1.26×

Docker image (with pre-warmed registry cache)

ProjectBaselinebuild-slicerSpeedup
zeroclaw (4 crates)794 s547 s1.45×

Registry-cache speedups (warm-cache daemon alone, verified Apr 2026)

Both baseline and warmed use nightly + -Z threads=8. Interleaved rounds, dispatch pre-warmed, rm -rf target/ before each run.

CrateBaselineWarmedSpeedup
image 0.254.9 s2.1 s2.3×
syn 2.01.0 s0.66 s1.5×

An earlier version of this table claimed 8.5× for image (40.7 s → 4.8 s) and 1.7× for syn (6.7 s → 4.0 s). Those baselines were measured without -Z threads=8 and the wild linker, while the warmed runs had them — the same apples-to-oranges error as the nushell 5.1×. cargo 0.87.1 (claimed 2.3×) is a regression with fair RUSTFLAGS (dispatch overhead serializes the parallel build).

Requirements

  • Rust stable (source slicing, warmup CLI)
  • Rust nightly (virtual slicer — requires rustc-driver feature)
  • Linux, macOS, or Windows (WSL recommended on Windows)