I'm just learning a bit about lower-level languages and I've noticed that gcc you can specify -march and -mtune parameters to optimise the software for particular CPU families.

But I've also found people saying that building a program from source won't make it noticeably faster than downloading the binary. Surely being able to have the software optimised for the CPU in your system would provide a notable speed boost, especially in software like ffmpeg which uses fairly microarchitecture-dependent features such as AVX?

What I'm wondering is, are the binaries on package managers somehow optimised for multiple microarchitectures? Does the package manager download binaries specific to my system's microarchitecture?

  • Looking at the gcc documentation, it seems likely that most distributed amd64 binaries use an march of "x86-64" and an mtune of "generic". This should allow the application to run on any amd64 CPU, and will tune the assembly to run fastest on the most common processors. This suggests that depending on the processor it may be possible to significantly improve performance by compiling from source, either by allowing the compiler to use microarchitecture-specific instructions or by improving the tuning for less-common processors. – Joshua Walsh Feb 3 at 9:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.