Here are the factors I can think of, from the top of my head:
- Kernel configuration
- The choice of CPU and IO scheduler
- How many applications are running at the same time once the system has booted
- The compiler flags used when compiling the kernel
- The compiler flags used when compiling the applications that are being used in the benchmarks
- The compiler (GCC vs Clang vs ICC, old GCC vs new GCC)
- Swappiness
- Choice of filesystem (ext4, XFS, BTRFS, ZFS)
- Disk configuration (software RAID)
For the case of Clear Linux, they pride themselves in:
- Optimizing compilation flags
- Using the latest Linux kernel
- Patching the kernel with custom patches to increase performance
- Using the AVX512 instructions, if the CPU can support them (which makes a huge difference)
Using the full instruction set that the CPU can offer has a significant impact.
For comparison, Arch Linux (and Manjaro) ships a kernel, libraries and executables compiled with GCC for a generic 64-bit x86 CPU (-march=x86-64 -mtune=generic
). This gives good performance, but not as good as executables compiled specifically for the CPU it is running on.
Using the elfx86exts tool on /usr/bin/ls
on Arch Linux shows which CPU instructions are needed, at a minimum:
$ elfx86exts /usr/bin/ls
MODE64 (call)
CMOV (cmovne)
SSE2 (movdqa)
SSE1 (movups)
CPU Generation: Intel Core
I have not had the occasion to try the same on Clear Linux, but I assume that a longer list of instructions will show up.
In summary, patching the kernel and tweaking the kernel configuration gives good result, but most importantly, supporting the available CPU instructions makes a big difference.