# Rust builds up to twice as fast by emitting metadata early

Original title: Emitting metadata early makes building/checking Rust up to twice as fast

> Hacker News story 49951218 · language: en · submitted 2026-10-04
> Web version: https://zeli.app/story/49951218
> About this feed: https://zeli.app/llms.txt · Agent guide: https://zeli.app/skill.md

▲ 148 · by [knuckleheads](<https://news.ycombinator.com/user?id=knuckleheads>) · 💬 41
[original](<https://github.com/PowderworksCode/headstart>) · [HN discussion](<https://news.ycombinator.com/item?id=49951218>)

## Summary

Headstart patches rustc and cargo to write early metadata as soon as a crate's interface is checked, letting dependents start compiling before dependencies finish type-checking. On 16 cores, clean builds of 13 real projects are up to 54% faster for cargo check and 42% for cargo build, with no slowdowns. Errors still surface with identical diagnostics and exit status.

## Key quote

> Headstart makes rustc write an early metadata file as soon as the interface is checked, and makes cargo start dependents on it.

## HN discussion (41 comments)

### [WalterGR](<https://news.ycombinator.com/item?id=49955636>)

> There’s an interesting comment thread (including potential downsides) about this technique in the submission for “How to speed up the Rust compiler in September 2026” from a couple days ago: https://news.ycombinator.com/item?id=49923594

### [scoopr](<https://news.ycombinator.com/item?id=49955801>)

> Huh, I kinda thought something like this was already being done, but perhaps it was a bit later stage. Neat!
>
> A kind of related shower thought I had, could rustc not instantiate generic methods, but write out what it expects to find (std::Vec<String>::push), and a separate build process listens to these, but makes sure already built ones are not built multiple times from the whole build.
>
> I don’t actually know how much of duplication there usually is, but I had gotten the impression that it would be part of the problem.
>
> Of course I’m no compiler engineer, and I’m sure there are complications like per crate build profiles, etc.

### [swiftcoder](<https://news.ycombinator.com/item?id=49953008>)

> Excited to see if there is a path to getting this in the mainline compiler

### [hmokiguess](<https://news.ycombinator.com/item?id=49954112>)

> So this is like a cache? Reminded me of https://turborepo.dev for TS, is it a similar concept?

### [tristenharr](<https://news.ycombinator.com/item?id=49954945>)

> Woah nice thought! :) good idea

---

## Cite

- Page: https://zeli.app/story/49951218
- Date: 2026-10-04
- Source: github.com (https://github.com/PowderworksCode/headstart)
- Hacker News: https://news.ycombinator.com/item?id=49951218

## Other languages

- zh: https://zeli.app/zh/story/49951218 · markdown: https://zeli.app/zh/story/49951218.md
- ja: https://zeli.app/ja/story/49951218 · markdown: https://zeli.app/ja/story/49951218.md
- ko: https://zeli.app/ko/story/49951218 · markdown: https://zeli.app/ko/story/49951218.md
- de: https://zeli.app/de/story/49951218 · markdown: https://zeli.app/de/story/49951218.md
- es: https://zeli.app/es/story/49951218 · markdown: https://zeli.app/es/story/49951218.md
- ru: https://zeli.app/ru/story/49951218 · markdown: https://zeli.app/ru/story/49951218.md
