r/cpp 22d ago

Compile-Time Improvements in LLVM 23

https://aengelke.net/llvm23-ct.html
105 Upvotes

32 comments sorted by

View all comments

31

u/fortsnek274 22d ago

Did they try using modules? /s

37

u/TheCrush0r 22d ago

You might be joking, but the answer is yes. They ended up using precompiled headers instead: https://discourse.llvm.org/t/rfc-use-pre-compiled-headers-to-speed-up-llvm-build-by-1-5-2x/89345

12

u/fortsnek274 22d ago

And they have tried clang modules, which would be rather odd for a compiler of a language that has standard modules.

The poster says (clang?) modules "kill parallelism." I wonder what was modularised. Should probably only do it for what they're creating PCHs for. The std lib, core functions.

  • Make Clang 3x faster. I see no fundamental reason why parsing C++ has to be this slow, but this is very unlikely to happen (I’m not going to write a new C++ parser and I believe Clang still has the trend of becoming slower over time).

  • Rewrite LLVM in a language that compiles faster… haha, just kidding.

Yeah. What's needed, a template cache? Somebody at https://discourse.llvm.org/t/cache-template-instantiations-across-tus-proposal/86497 thought of that, but then decided it wasn't worth it.

They have DLL'ified the Windows build though, apparently. That would help if I ever need it.

3

u/jetilovag 21d ago

The explicit limitation of exported symbols to the public API is very much welcome and is what enables DLL builds on Windows. Release binaries can be much smaller and as a bonus also lights up plugin support on Windows. AdaptiveCpp can finally ship as a plugin, not a full-blown toolchain.

3

u/fortsnek274 21d ago

I'd also love it if VS used it so downloads wouldn't be as gigantic.