AI NewsProductivityAnnouncement

Headstart, a rustc and cargo patch, makes cargo check up to 54 percent faster on 13 real Rust projects

Headstart, a nine-patch series against rustc and cargo, lets a dependent crate start compiling on a dependency's interface before its function bodies finish type-checking, and the author reports cargo check up to 54 percent faster on 13 named projects.

AI News

Editorial3 min read

LinkedInX
GitHub social card for the PowderworksCode/headstart repository

Image: GitHub

Why it mattersRust's build time is one of the ordinary reasons teams move to another language, so a measured 24 to 54 percent cut on clean builds of real projects is worth reading before deciding how much faster Rust can be made on current machines.

Rust's build time is one of the ordinary reasons teams move away from the language, and most of a clean build is one crate waiting on another to finish type-checking function bodies that the dependent does not read. A patch series posted to GitHub this week by a developer under the handle PowderworksCode changes when the wait ends. It lets a dependent start compiling as soon as its dependency's interface, the public item signatures, has been checked, and reports clean builds up to 54 percent faster on 13 named Rust projects.

The repository, called headstart, was created on 27 September 2026 and reached the Hacker News top stories list on 4 October with 75 points. GitHub lists 18 stars at the time of writing.

What it changes in rustc and cargo

Headstart is nine patches on top of upstream rustc and cargo, meant to become pull requests. On the rustc side, a new analysis_interfaces query splits analysis into item interfaces and function bodies, and the driver writes an .early-rmeta file between them. Crate loading in a dependent accepts the early metadata, and swaps in the full metadata before code generation, waiting on a lock the producer holds until it is written. On the cargo side, dependents start on the early-metadata notification for both cargo check and cargo build, and a paused compilation gives its job slot back to other work. If a function body fails to check later, cargo drops the dependent and reports the original error with the same diagnostics as today.

The numbers the author published

PowderworksCode measured clean builds of 13 real projects, including rust-analyzer, zed, bevy, lemmy and polars, on a 16-core machine. On rustc's default front end, cargo check runs up to 54 percent faster and cargo build up to 42 percent, and no project is slower. With the parallel front end (-Zthreads=8), which already covers some of the same ground, headstart adds up to 25 percent. The gain comes from cores the build would otherwise leave idle, so it shrinks on smaller machines: on 4 cores, rust-analyzer check is 24 percent faster, build 13 to 15 percent, and codex-rs check 14 percent.

The method is published in the repository. scripts/real-projects.sh clones the 13 projects at the commits measured, and scripts/bench.sh runs the medians with headstart off and on. scripts/sweep.sh builds the 53 rustc-perf compile benchmarks in both modes and compares diagnostics, which is how the author checks that errors still land correctly.

Context from the Rust compiler team

In the Hacker News thread, Rust team member kibwen pointed out that the Rust project added pipelining through eager metadata emission in 2019, and has moved this direction since. More eager pipelining has been eyed for a while, with the open question being what to do when a crate speculatively approved later fails. Headstart's answer is to run the dependent and discard its output on failure, so the cost of a late error is extra work and the gain on a successful build is parallelism.

The author notes three costs plainly: work downstream that gets thrown away when a body does not check, errors reported later than today, and more memory in use at once. The patch set is marked as a commit series meant to become upstream pull requests, with a docs/readiness.md on whether it is ready to bring to the compiler and cargo teams.

For a Rust team deciding whether to improve build times before buying machines with more cores, headstart is a measured option to run against your own repository and compare.

Source

Primary source: PowderworksCode/headstart on GitHub. Discovery: Hacker News thread, where the submitter linked the repository.

This item was written by an AI system from the linked source. Reveneau is responsible for what it publishes.

Share
LinkedInX