4 ms·
Yeah, I was talking about C++ specifically. I am extremely skeptical you can get that much better for C++ without sacrificing performance, correctness, etc. Ru
by jchw 3y ago
Yeah, I was talking about C++ specifically. I am extremely skeptical you can get that much better for C++ without sacrificing performance, correctness, etc.
Rust is different. It has a completely different design for translation units and modules that C++ can't adopt without hard breaking changes, due to e.g. the way its macro system works.
There are teams at all of Google, Microsoft, et al that spend time on C++ build performance. At this point, it's not even necessarily just about faster build times. Their builds could be measured in environmental impact at that scale.
- thechao 3y agoI feel like there's room for C++ without headers or includes — a completely clean break.
- johntb86 3y agoMold is substantially faster than other linkers [0], so that's evidence there's still room for improvement in the C++ compiler space. It does help that there are a lot of linker features that are only used in special environments (like bare-metal systems). [0]: https://www.gem5.org/project/2023/02/16/benchmarking-linkers.html https://www.gem5.org/project/2023/02/16/benchmarking-linkers...
- jchw 3y agoMold really is a big improvement, I'll give you that. (I'm a big fan of mold, to the point where I happily joined the Github Sponsors when it went more open recently.) But, the compilation stage is a tough nut to crack.
- pjmlp 3y agoC++ also has modules.
- jchw 3y agoFor right now, this doesn't seriously help the problem, for multiple reasons. C++ modules actually tend to reduce compilation performance, since modules need to be processed before their dependents, whereas normal translation units are fully independent of each-other.
- pjmlp 3y agoIt surely does, as per Microsoft remarks doing import std; is faster than #include <iostream>. Since VC++ modules support got good enough, that all my side projects only use modules.