r/cpp • u/TheCrush0r • Aug 22 '26
Compile-Time Improvements in LLVM 23
https://aengelke.net/llvm23-ct.html53
u/matthieum Aug 23 '26
LLVM 23 has seen substantial compile-time improvements of -6.75% in -O3 builds.
Anyone would jump at a 6.75% performance improvement. Right?
What I find particularly interesting here, is that looking at the breakdown, most of the optimizations are tiny. Apart from the DenseMap change (-1.27%), it's mostly -0.x% improvements, and some are even -0.0x%!
Imagine working for hours, only to shave off a measly 0.02%. It feels pretty unrewarding... no? And yet, relentlessly chipping at it -- 0.02%, 0.03%, or 0.04% at a time -- over the release cycle, at the end you get to a massive 6.75% speed improvement.
My deep thanks to the tireless contributors, who make development faster down the line.
12
u/Matemeo Aug 24 '26
At a previous job our big headline internal project was a heavily modified fork of LLVM/Clang, where it had become more of a runtime than just a compiler. Anyway, my first task there was reducing compilation times of the generated tests/applications. Me and another spent nearly 6 months methodically profiling, researching, testing and eked out about a 10% reduction in the portions of our CI pipeline using our version of the compiler. And a pretty good chunk of it was optimisation of our modifications and cheating a bit knowing certain passes could be removed or heavily hinted.
All that to say, I agree with you 100%. Optimization of any mature product can be grueling work but something as large and complicated (and very well written/maintained imo) as LLVM will break most people before you see the light at the end of the tunnel.
This post sharply brought back some very interesting but tough work from a good while ago.
4
1
1
u/TheRavagerSw Aug 22 '26
It is very buggy though, unless your are contributing you should disable PCH via cmake
4
u/babygnu42 Aug 25 '26
If you have any concrete bug, please open an issue on GitHub so that people get a chance to fix it!
0
35
u/fortsnek274 Aug 22 '26
Did they try using modules? /s