The headstart patch set lets Cargo start compiling dependent crates as soon as their interfaces are type‑checked, cutting cargo check times by up to 54% and cargo build times by up to 42% on a 16‑core machine — all while preserving the same error messages and exit codes as the standard toolchain.
Early‑metadata pipeline
headstart adds a -Zearly-metadata flag to rustc that writes an .early‑rmeta file after the interface of a crate is checked, before function bodies are analyzed. Cargo receives this file via the -Zheadstart flag and launches dependent crates immediately, letting them run their analysis on the early metadata. For a cargo check, dependents run to completion on the early data; for a cargo build, they pause before code generation, wait for the full metadata, then resume. The design is described in the project's docs/design.md.
Real‑world speed numbers
On the default front‑end, the patch was benchmarked on 13 open‑source projects (including rust‑analyzer, zed, bevy, lemmy, and polars). Clean builds saw up to 54% faster cargo check and up to 42% faster cargo build, with no project slower than the baseline. With the parallel front‑end (-Zthreads=8), gains top out at 25%. Smaller machines still benefit: on a 4‑core box, rust‑analyzer's check is 24% faster and its build 13‑15% faster.
Trade‑offs and current status
The approach trades extra memory usage and a slight delay in error reporting for the speed boost. Work performed on downstream crates may be discarded if a dependency later fails, and the build holds more .rmeta files in memory at once. The patches are not yet merged upstream; they live as a six‑patch series for rustc and a three‑patch series for cargo, intended to become pull requests. The repository does not provide pricing—it's open source—and it does not list any official stability guarantees.
Trying it out
To experiment, clone the repo, apply the patches, and build the patched toolchain. Then run either:
RUSTC=/path/to/headstart/rustc/build/host/stage1/bin/rustc \
/path/to/headstart/cargo/target/release/cargo check -Zheadstart
or enable the unstable flag:
CARGO_UNSTABLE_HEADSTART=true cargo check
The scripts in scripts/ provide benchmarks and smoke tests to verify the speed gains on your own codebase.
What to watch: keep an eye on the repository’s readiness documents and any upstream pull‑request activity. When the patches land in the official Rust compiler or Cargo releases, you can adopt them without building a custom toolchain.



