News: 0001602789

  ARM Give a man a fire and he's warm for a day, but set fire to him and he's warm for the rest of his life (Terry Pratchett, Jingo)

Some Meaningful Performance Benefits For Clang + LTO Built Linux Kernels

([Software] 4 Hours Ago 8 Comments)


Over the past few years building the Linux kernel with Clang has matured a lot thanks to upstream improvements to both LLVM/Clang and the Linux kernel. As it's been a while since our last comparison for GCC vs. Clang built kernels on the resulting system performance, our latest year-end 2025 benchmarking is providing a fresh look at the Linux 6.19 upstream Git kernel built under the latest stable GCC 15 and LLVM Clang 21 compilers. Plus with the Clang-built kernel is also the option of the [1]Link-Time Optimization (LTO) kernel for even greater performance.

Today's benchmarking is looking at the performance of the same Linux 6.19 Git kernel revision built under a few different configurations:

- Using GCC 15.2 to build the kernel as is commonly done by a majority of the Linux distributions using the GNU Compiler Collection as the default compiler.

- Using LLVM Clang 21.1.7 to build the Linux 6.19 kernel in the same kernel configuration as the GCC built kernel.

[2]

- The same LLVM Clang 21.1.7 build configuration as above but opting for a Clang Full LTO kernel build rather than the Thin LTO option.

The three kernels were tested on the same workstation: an AMD Ryzen Threadripper PRO 9995WX on an ASUS Pro WS TRX50-SAGE WIFI motherboard with Radeon AI PRO R9700 graphics and 2TB Corsair MP700 PRO PCIe 5.0 NVMe SSD.

An Ubuntu 26.04 development snapshot was running on this AMD Ryzen Threadripper PRO workstation and the only change made between the testing runs was swapping the kernel builds as noted above.



[1] https://www.phoronix.com/search/link-time+optimization

[2] https://www.phoronix.com/image-viewer.php?id=linux-kernel-llvm-clang-lto&image=kernel_clang_lto_lrg



The story of the butterfly:
"I was in Bogota and waiting for a lady friend. I was in love,
a long time ago. I waited three days. I was hungry but could not go
out for food, lest she come and I not be there to greet her. Then, on
the third day, I heard a knock."
"I hurried along the old passage and there, in the sunlight,
there was nothing."
"Just," Vance Joy said, "a butterfly, flying away."
-- Peter Carey, BLISS