logoalt Hacker News

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

113 points • by knuckleheads • today at 6:26 AM • 30 comments • view on HN

Comments

WalterGR • today at 5:00 PM

There’s an interesting comment thread (including potential downsides) on 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

➕ show 1 reply
scoopr • today at 5:16 PM

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.

➕ show 1 reply
swiftcoder • today at 11:41 AM

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

➕ show 1 reply
hmokiguess • today at 2:15 PM

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

➕ show 3 replies
tristenharr • today at 3:49 PM

Woah nice thought! :) good idea

rouanvde • today at 1:38 PM

Those are big improvements!

quotemstr • today at 5:31 PM

As an aside, it's just silly to make the repository a bunch of checked-in patches. Git already does revision control. You don't need to do revision control in your revision control.

➕ show 1 reply
paradiselord-de • today at 8:45 PM

[flagged]

IshKebab • today at 1:55 PM

Seems like an easy win! I'm kind of surprised nobody did this already. I guess someone will need to reimplement this by hand given Rust's AI policy, but this is still great because it demonstrates that it's a really good idea.

➕ show 1 reply