I have started contributing to rustc this year as a part of the #wg-compiler-performance, which is focused on making the Rust compiler as fast as possible. This post describes some things that I and several other rustc developers have been working on for the last several months in order to help fulfill this goal.
What’s possibly a bit unusual is that most of my efforts weren’t focused on improving the source code of rustc itself, but rather on improving the way we compile/build rustc in order to make sure that it’s as efficient as possible.
I’ll try to talk about the individual changes in chronological order, but some them were overlapping, so it might not match up perfectly. I will also add links to PRs, performance results and mean/max. improvements to each section where it is applicable. The efforts mentioned here were done with the help and guidance of many other rustc developers (@nnethercote, @lqd, @Mark-Simulacrum, @bjorn3 and many others). I’m very thankful for their continued help and assistance.
Before we begin talking about the improvements that were made this year, I’ll try to describe how was rustc built for Linux targets on CI at the beginning of 2022. We will see at the end of the blog post that the pipeline has been modified since then, but it’s still quite similar. This build pipeline is used for building the actual release artifacts that are distributed via e.g. rustup and eventually find their way to Rust end-users (on Linux).