Get the latest tech news

Why is the Rust compiler so slow?


I spent a month repeatedly building my website in Docker, and now have horrors to share. I've got a problem.

Unfortunately, this won't work here — the change in arguments will invalidate the cached dependencies from cargo chef cook, and there's no equivalent way to pass additional rustc flags through cargo-chef. This particular run took ~110 seconds on a 16-core machine, so it's clear that some passes are being double-counted (which makes sense — we see both ModuleInlinerWrapperPass and InlinerPass, and it looks like OptModule probably just calls OptFunction). While I did hit a lot of issues here, the tooling honestly worked really well – and the documentation was sufficient for someone with relatively little experience to make meaningful improvements to their codebase.

Get the Android app

Or read this on Hacker News

Read more on:

Photo of Rust

Rust

Photo of rust compiler

rust compiler

Related news:

News photo

Rust 1.88 Released With Improvements For Naked Functions, Chaining Let Statements

News photo

Microsoft Edit

News photo

Higher: Favourite Haskell type classes for Rust (2023)