Dienstag, 23. Juni 2020

kcbench, the Linux kernel compile benchmark, version 0.9.0 is out

Hello, is this thing still on? Looks like I have not blogged here in nearly 10 years. Uhhps. But today there is a reason to write something again:

I released kcbench 0.9.0. Kcbench is a simple Linux kernel compile benchmark that downloads the Linux sources and measures the time it takes to build the kernel. This is how it looks:

One can use the benchmark to compare different machines, just make sure they use a similar compiler. Kcbench can perform stress tests, too. It's also useful to find the optimal number of jobs for compiling source code, as 'just use all cores' sometimes is not the fastest setting.

For example, on a AMD Ryzen Threadripper 3990X (64 cores/128 threads) a lot of people will expect compiling with 128 jobs (`make -j 128`) will be fastest. But while testing kcbench on a such a processor it turned out that at least the testes machine built a Linux kernel quite a bit faster with only 64 jobs (and thus utilizing only the real cores):


There was no time for a closer inspection, but it looks like memory and its caches might have been a bottleneck that lead to this. It was different on a AMD EPYC 7742 (128 cores/256 threads), as using 256 jobs there lead to the best result:
For more about kcbench see the project page at gitlab, the README and the man-pages for kcbench and kcbenchrate. The rate variant is one of the big new enhancements in the new version. Instead of compiling one kernel really fast kcbenchrate compiles one kernel on each CPU to measure the rate and keep the all cores busy all the time. See the man-pages for a more detailed explanation of the approaches the two use. Cross-compilation is supported now, too. To learn about all the other improvements in kcbench v0.9.0 see its release page.

The new kcbench including kcbenchrate is in Fedora Rawhide. It's also in updates-testing for Fedora 31 and Fedora 32 currently and will be moved to the proper updates repositories in a few days.