The Spectrum Dispatch News

technology

Rust Compiler Speeds Up 4.57% in Two Months With New Optimizations

A series of improvements to the Rust compiler achieved significant performance gains from July to September 2026, with contributions from multiple developers targeting bottlenecks.

Rust Compiler Speeds Up 4.57% in Two Months With New Optimizations

The Rust compiler saw substantial performance improvements over a two-month period, according to a post by Nicholas Nethercote. From July 29 to September 28, 2026, measurements showed a mean wall-time reduction of 4.57% across 629 benchmark measurements, with 555 improving and only 74 regressing.

Rust Compiler Speeds Up 4.57% in Two Months With New Optimizations

Several major initiatives drove these gains. An LLVM upgrade to version 23 achieved a 1.2% mean wall-time reduction across all benchmarks. Clippy received a 18% wall-time improvement in some cases after Jakub Beránek enabled Profile-Guided Optimization (PGO) for the tool.

Two new compiler features—the Polonius Alpha borrow checker and a new trait solver—were enabled on Nightly but initially caused some regressions. Jack Huey addressed Polonius Alpha performance by making liveness computations lazy, reducing instruction counts for the serde crate by 3-5%, and by adjusting data structures and inlining patterns for mostly sub-1% reductions elsewhere.

Contributor xmakro made multiple optimizations: a specialization graph improvement yielded a 1.58% mean cycle count reduction; incremental compilation loading optimization achieved up to 6% instruction count reductions; and avoiding allocations in trait solver selection code provided sub-1% reductions.

Nicholas Nethercote made several targeted improvements. A CFG traversal algorithm change for dataflow analysis yielded approximately 30% wall-time reduction for the cranelift-codegen crate, which contains a function with over 18,000 basic blocks. Optimizations to the EverInitializedPlaces analysis reduced match-stress benchmark instruction counts by 17%.

Chris Denton increased the compiler’s default stack size, allowing removal of manual stack extension mechanisms in recursive-prone code, reducing instruction counts by up to 3% in some cases. Nethercote also made minor AST-to-HIR lowering improvements that unexpectedly yielded up to 1.5% instruction count reductions.

The volume of performance improvements was substantial enough that Jonathan Brouwer created a rollup merging 10 performance-improving PRs to manage the merge queue, a first occurrence for the project.

Key facts

  • Mean wall-time reduction of 4.57% from July 29 to September 28, 2026
  • 555 of 629 benchmarks improved; 74 regressed
  • LLVM 23 upgrade achieved 1.2% mean wall-time reduction
  • Clippy received up to 18% wall-time improvement with PGO
  • CFG traversal optimization provided ~30% wall-time reduction for cranelift-codegen
  • EverInitializedPlaces optimization reduced match-stress benchmark by 17%

Sources

← All posts