- 29.52s -> 24.47s (17.1%)
- 27s -> 19s (29.6%)
- 11.5s -> 8.4s (26.9%)
- 37.5s -> 29.6s (28.7%) - this measurement from TFA.
To put these numbers in context, all the perf improvements over the last 4 years have helped the compiler become faster on a variety of workloads by 7%, 17%, 13% and 15%, for an overall speed gain of 37% over 4 years. [2] So one large change providing a 20-30% improvement is very impressive.
When you add that to the parallel frontend [3] and support for linking with LLD [4], Rust compilation could be substantially faster by this time next year.
[1] - https://old.reddit.com/r/rust/comments/1bgyo8a/try_cranelift...
[2] - https://nnethercote.github.io/2024/03/06/how-to-speed-up-the...
[3] - https://blog.rust-lang.org/2023/11/09/parallel-rustc.html
> A full debug build of Cranelift itself using the Cranelift backend took 29.6 seconds on my computer, compared to 37.5 with LLVM (a reduction in wall-clock time of 20%). Those wall-clock times don't tell the full story, however, because of parallelism in the build system. Compiling with Cranelift took 125 CPU-seconds, whereas LLVM took 211 CPU-seconds, a difference of 40%. Incremental builds — rebuilding only Cranelift itself, and none of its dependencies — were faster with both backends. 66ms of CPU time compared to 90ms.
> A paper from 2020 [0] showed that Cranelift was an order of magnitude faster than LLVM, while producing code that was approximately twice as slow on some benchmarks.
> A full debug build of Cranelift itself using the Cranelift backend took 29.6 seconds on my computer, compared to 37.5 with LLVM (a reduction in wall-clock time of 20%)
That seems much smaller difference than what I would have expected
Don't have numbers handy, so hard to say how much faster Cranelift is making the codegen portion, but gets into Amdahl's Law
…why is it still the default?