Developer Tools6 min read

Rust's compile times are now an ecosystem problem, not a compiler one

A decade of rustc tuning has run up against diminishing returns. The next big speedups will come from how Rust code is written and built, not from the compiler.

By Curious Technologist Editorial

Nicholas Nethercote's dispatches on speeding up rustc have become something like a tide chart for the Rust ecosystem. Read enough of them in a row, going back to the mid-2010s, and a pattern stands out that no single post states outright. The compiler is no longer the main reason Rust builds are slow. It is still the place we look, because it is the one component with a dedicated performance culture, a public benchmark suite and someone writing about it in clear prose. That is a reason to admire the work, and it is also a reason to stop expecting it to solve the problem.

The easy wins are behind us

Compiler performance work follows a familiar curve. Early on, profiling turns up embarrassing things: quadratic algorithms, redundant hashing, allocations in hot loops. Fixing them produces double-digit improvements that justify a blog post each. Later, the profile flattens. No single function dominates, and every remaining percentage point costs more engineering time than the last one. Anyone who has watched the rustc-perf dashboards over the years has seen this happen. Improvements now tend to arrive as many small gains spread across benchmarks, plus the occasional structural change that lands after years of groundwork.

That is not a criticism of the people doing the work. Writing up careful, measured, incremental progress, including the attempts that failed, is one of the most useful habits in open source compiler engineering. GCC and LLVM have never had a comparable public narrative of their own compile-time performance. But the shape of the curve matters for what users should expect. If your clean build takes four minutes today, no sequence of 1-3% wins in the frontend will bring it under one.

The compiler can only go as fast as the code we hand it lets it go, and we keep handing it more generics, more macros and more crates.

Where the time actually goes

The biggest compile-time improvements of recent years have mostly come from outside the compiler's core algorithms. Switching the default linker to lld on x86-64 Linux, which as I understand it reached stable in 2025, was a large wall-clock win for link-heavy workloads, and nothing about it was clever compiler engineering. It was a change to a default. The parallel frontend, available on nightly behind a flag since late 2023, is a structural change rather than a micro-optimisation, and its long path toward stable shows how hard structural changes are to finish. The Cranelift backend points at the same thing from the other direction: much of a debug build's cost lives in LLVM codegen, which rustc's own engineers control only indirectly.

Meanwhile the workload keeps growing. A typical serious Rust service pulls in hundreds of transitive crates. Proc macros run arbitrary code at compile time, and the most popular derive macros generate a lot of code per type. Generic-heavy APIs, which the ecosystem rightly praises for zero-cost abstraction, push monomorphisation costs onto every downstream crate that instantiates them. The cost is not zero. It moves from runtime to compile time and gets multiplied across the dependency graph.

This is the part the usual compile-time discourse gets wrong. Complaints get aimed at rustc, and rustc gets faster, and builds stay roughly as slow because the amount of code has grown to fill the space. Economists will recognise this as a form of Jevons paradox: making compilation cheaper encourages more of it.

In practice: the largest wins available to most teams today are things they control directly. Use a faster linker if your platform doesn't already default to one. Split giant crates so incremental compilation and parallelism have something to work with. Audit which dependencies pull in heavy proc-macro stacks. Use cargo build --timings to find the crates on the critical path. Consider moving generic code behind a non-generic inner function so it is compiled once. None of this is glamorous, and all of it beats waiting for the next release.

The strongest objection

The best counter-argument is that this shifts blame onto users for a language design choice. Rust chose monomorphisation, a powerful macro system, crate-level compilation units and LLVM. Telling developers to restructure their code around the compiler's limits is exactly what Rust's ergonomics were meant to make unnecessary. Go, its defenders would note, treated compile speed as a language-level design constraint from the beginning, and it shows.

That objection is mostly right about the cause and wrong about the remedy. Yes, Rust's compile times come from deliberate trade-offs, and yes, the language could have chosen differently. But it didn't, and it won't now. Given that, the useful question is which lever moves the number. Compiler work is necessary and should continue. It also has a ceiling set by the volume and shape of the input. Library authors, by contrast, have barely started treating compile time as an API property. A crate's documentation will benchmark its runtime throughput to three significant figures and say nothing about what it costs a dependent crate to build. That asymmetry is a cultural choice, and cultural choices are cheaper to change than compiler architecture.

Who pays, and who should

The economics deserve a moment too. Compiler performance work concentrates its benefits widely and its costs narrowly. Every Rust developer gains from a faster rustc. Only a small number of people, funded by whichever employer or foundation is paying that year, do the work. That is the usual open source commons problem, and the Rust project has been unusually open about how much depends on a few contributors. The companies with the largest Rust codebases, the ones running thousands of CI builds a day, capture most of the dollar value of each percentage point. Funding the work in proportion to that value would be rational. It would also be the cheapest compute optimisation many of them could buy.

The second-order effect worth watching is CI. Compile time on a developer laptop is an annoyance. Compile time multiplied across every pull request in a large monorepo is a line item. As Rust spreads into large organisations, the pressure will move from compilers to build systems: remote caching, hermetic builds and distributed compilation via tools like sccache or Bazel-style setups. Those tools can deliver order-of-magnitude improvements for repeated builds, which no frontend optimisation can.

So keep reading the tide charts. They are honest, technically excellent, and a model of how performance work should be reported. But read them as a measure of how much headroom is left in one component, not as a promise that the whole system will get fast. The rest of the speedup is in our dependency trees, our generics and our CI configuration, and nobody else is going to write that blog post for us.

Sources & further reading

The analysis above is our own. The underlying reporting and primary documents are credited here.