Performance difference between compiled and binary linux distributions/packages

The performance difference will be in almost all cases minimal and not worthwhile. Good reasons to use source distributions (while rolling your own binary packages, as gentoo’s bindist system allows) include:

  • Deploying your own custom patches
  • Customizing your kernel easily
  • Packaging your own updates

If you’re not doing any of these things, you don’t need a source distribution. For personal use they’re very convenient because they allow you to upgrade things incrementally at will without worrying too much about binary compatibility, which is not a concern I see often in an enterprise setting.

It’s worth noting that you can do these things with a binary distribution as well, by making your own RPM packages or whatever. The management overhead is similar.

You will basically not see a 15% speed increase by compiling from source. I’d be loathe to estimate it at even as high as 5% in any reasonable case. Compiling from source gets you a couple things:

  • You get to use your preferred compiler version
  • You can direct the compiler to generate instructions from ISA extensions not used in binary distributions’ packages, such as AESNI and AVX

However, the compiler very rarely actually generates these anyway, and the overall savings from using them are generally very miniscule when the application’s performance is taken as a whole. Things like RAM accesses (and latency) and disk and device latency are much bigger factors, and you should really start there.

Applications which might benefit from a custom compilation that will only run on a relatively recent Intel core i7 or i5 include ones that do a lot of vector math and ones which do a lot of AES encryption and decryption, or require a lot of random numbers. If you want to use the Intel DRBG you would need to do this as well, currently.

If none of these apply to you, you’ll be quite happy with any of the debian or red hat based distributions out there, and will have a lot less maintenance overhead.

Leave a Comment