October 6th, 2024

Speeding up the Rust compiler without changing its code (2022)

Efforts to enhance the Rust compiler's performance include expanding PGO profiling, updating LLVM, and refining benchmarks. Challenges on macOS hinder progress, but improvements in profiling precision show potential for optimization.

Read original articleLink Icon
Speeding up the Rust compiler without changing its code (2022)

The blog post discusses efforts to enhance the performance of the Rust compiler (rustc) without altering its source code. The author, a contributor to the rustc performance working group, outlines various strategies implemented over several months to optimize the compilation process. Key improvements include expanding Profile-Guided Optimization (PGO) profiling for LLVM, updating LLVM versions, and refining the PGO benchmark suite. The author highlights the importance of gathering accurate PGO profiles to optimize both LLVM and rustc effectively. Additionally, attempts were made to apply PGO on macOS, although challenges with CI build times hindered progress. The post also details improvements in precision for PGO profiling and the exploration of Call-Site aware PGO, which, despite mixed results, indicates potential for future optimization. The author emphasizes the significance of using modern benchmarks and adapting the PGO process to include a wider range of crates, ultimately leading to performance gains. The ongoing work aims to ensure that rustc remains efficient and competitive in the landscape of programming languages.

- The Rust compiler's performance is being improved through various optimization techniques without changing its source code.

- Key strategies include expanding PGO profiling, updating LLVM versions, and refining benchmark suites.

- Challenges with CI build times on macOS have limited the application of PGO on that platform.

- Improvements in profiling precision have led to better optimization outcomes.

- The ongoing efforts focus on adapting to modern benchmarks and enhancing the efficiency of rustc.

Link Icon 3 comments
By @karmakaze - 7 months
> …Yes, I know that the title looks like a clickbait. But it’s actually not that far from the truth :)

It is clickbait, what was actually changed?