Hacker News new | past | comments | ask | show | jobs | submit login

> 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.




That'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 (yes, I know about disabling kptr_restrict)

Our next big project is to look into lazy parsing.


Who's "our" here?


"People who care about improving compile times of the Linux kernel with Clang."

"There are literally dozens of us!" /s


the linked image has a name associated with it. Googling that name should answer your question


To save people the click and search: Someone from Google who works on compiling Linux.


The 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




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: