How does compiling source code oneself result in better performance than using yum?


Well, with yum you receive a precompiled program that fits the distribution.

Choosing, source compilation on that same distribution will not give any speed-ups unless you mess with the compiler options, or build a static version that links the libraries with the binary, instead of having to link the libraries on load-time.

Thus, just downloading the source and doing compilation will not necessarily result in faster execution. In many cases it will be slower. Because the people that have prepared the package are many times more proficient and informed on this specific package than you.

However, if you know what you are doing you can configure the compiler, or even use a better compiler and edit the codebase if needed, to produce a better result.


When you compile it the program is tailored to your hardware and doesn't contain the extra data required to make it portable. The performance gain is not noticeably though so you should not be concerned about compiling your stuff unless you are a freak about it.


Another point are dependencies.

On Unix-like systems programs often call one another and are designed to be very modular. So for example mplayer may output video using DirectFB or using aalib or libcaca or using standard fbcon framebuffer, using OpenGL video outpput, using X and so on.

If you for example don't need ACII output produced by aalib and libcaca, when compiling program, you can just disable them. On the other hand package maintainer may decide that such options are very popular and have them enabled in package.

If you use the package, parts of unneeded code remain in the program and they can slow down execution.

Sometimes, it can get worse. Package maintainer may decide to compile a program with support for some other package. Then that package is marked as dependency and will need to be installed. If your system for some reason doesn't work well with that other package installed, you won't be able to use the program you want to use because of its optional support for some package. I had such problem when PulseAudio was new. It just wouldn't work on my system and then I had problems switching to ALSA because large number of audio packages depended on Pulse, even if support for Pulse wasn't critical to package's operation.

  • "If you use the package, parts of unneeded code remain in the program and they can slow down execution." I am not sure on that. Unused code delays load time in principle and increases memory usage. Unless we are talking a gross amount of code there shouldn't be a considerable slowdown. – g24l Mar 25 '11 at 23:14

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.