I looked up specifically examples of this and didn’t find answers, they’re buried in general discussions about why compiling may be better than pre-built. The reasons I found were control of flags and features, and optimizations for specific chips (like Intel AVX or ARM Neon), but to what degree do those apply today?
The only software I can tell benefits greatly from building from source, is ffmpeg since there are many non-free encoders decoders and upscalers that can be bundled, and performance varies a lot between devices due to which of them is supported by the CPU or GPU. For instance, Nvidia hardware encoders typically produce higher quality video for similar file sizes than ones from Intel AMD or Apple. Software encoders like x265 has optimizations for AVX and NEON (SIMD extensions for CPUs).
Back when I was running Lubuntu I had to build OpenMW from source because of some issue with OpenSceneGraph. But that’s like really specific and probably not an answer you’re looking for lol.
Yeah it’s easier to compile software with support for the latest vector extensions etc. if you do it from source. It is also possible to do runtime detection and switch between implementations that way, but it requires more work.
Tbh I don’t think it would make much difference in practice. If you are ok with supporting only recentish CPUs you can use one of these options:
-
-march=x86-64: CMOV, CMPXCHG8B, FPU, FXSR, MMX, FXSR, SCE, SSE, SSE2
-
-march=x86-64-v2: (close to Nehalem) CMPXCHG16B, LAHF-SAHF, POPCNT, SSE3, SSE4.1, SSE4.2, SSSE3
-
-march=x86-64-v3: (close to Haswell) AVX, AVX2, BMI1, BMI2, F16C, FMA, LZCNT, MOVBE, XSAVE
-
-march=x86-64-v4: AVX512F, AVX512BW, AVX512CD, AVX512DQ, AVX512VL
v2 is definitely fine and v3 is probably acceptable by now.
In short I don’t think
-march
is a compelling argument for avoiding binary distribution. If it really makes a big difference either distribute multiple versions of your software using the flags above, or do runtime detection.and v3 is probably acceptable by now.
No.
why
-
I always build Python and Postgres from source. It’s satisfying to do and it feels weird to not be in control of two of the most important parts of the stack. I don’t want to be at the mercy of some other org’s timeline for getting a new version.
does it effect performance at all?
I assume if you build from source you can pull out some things you won’t need but I have always wondered if performance is a factor when people compile from source.
It could, if you wanted to build it with any of the performance related build options changed, but for most people that’s probably overkill. I don’t think excluding anything will make a noticeable difference.