5 ms·
> Phoronix even have GCC faster than Clang at building the Linux Kernel, even in an (according to a comment) biased sample where GCC wasn't built with lto enabl
by MaxBarraclough 6y ago
> Phoronix even have GCC faster than Clang at building the Linux Kernel, even in an (according to a comment) biased sample where GCC wasn't built with lto enabled.
I don't see that this tells us anything negative about Clang. How is it a bad thing for the compiler to give you the option of a very slow build using additional optimisations? If you don't want that, then don't use that feature.
- deleted 6y ago[deleted]
- ndesaulniers 6y agoThat's not what's going on though. Clang's not slow because LLVM is using additional optimizatons, it's slow because Clang is spending a ton of time in the frontend mostly lexing and keeping track of source locations for macro tokens. (I literally just looked at a perf record of a whole build of the linux kernel with Clang; and know more about the subject than...anyone). ToT LLVM, linux-next x86_64 defconfig: https://photos.app.goo.gl/hNwwy2K1Gh7Uc2D67 https://photos.app.goo.gl/hNwwy2K1Gh7Uc2D67 (yes, I know about disabling kptr_restrict) Our next big project is to look into lazy parsing.
- gsnedders 6y agoWho's "our" here?
- gfxgirl 6y agothe linked image has a name associated with it. Googling that name should answer your question
- ralfd 6y agoTo save people the click and search: Someone from Google who works on compiling Linux.
- ndesaulniers 6y ago"People who care about improving compile times of the Linux kernel with Clang." "There are literally dozens of us!" /s
- mhh__ 6y agoThe performance is basically neck and neck (GCC can be measured to be faster at a few SPEC benchmarks, but they can be contrived and the kernel is often hyper-optimized so the difference may not be down to the optimizer). GCC in this case gives you equal or as-near-as-makes-no-difference up or down performance in less compilation. Some rigs are now posting 17s Kernel build times, reasons to be cheerful