Does a package performance is different when it's compiled from sources, or installed from repository ? Is it possible, what during the compilation, the package will be "more adapted" (performance, stability) to Your system, if it's compiled on it ?

  • i know one point surely . If you manually installed a package means thats not going to receive any updates from Ubuntu . even any updates are released , you have to get them manually . But if you installed a package from repository then it will receive all kind of its updates like Bug fixes , new releases . Hope that helps a bit.
    – Raja G
    Jul 2, 2012 at 14:53
  • Thanks. The question is about performance, I'm informed about updates, which should be done manually in such case. F. Feb 14, 2013 at 11:39

4 Answers 4


Unless you are doing serious optimization during the build, or making significant changes to what features you are building, for very complex programs, it is very unlikely you will see any performance benefit. And even with the serious optimizations, you will still only see minimal improvement. There's no real advantage to building applications in such a manner, on Ubuntu, for the most part.

  • Although I agree with you in general, one caveat would be when a newer version (that contains performance/stability enhancements) is available from source than the one available in the repos.
    – reverendj1
    Jul 2, 2012 at 15:36
  • 1
    Perhaps, but the question implied explicitly those versions in the repo, as if the binary compilation as-is is performance detriment itself. If a newer version exists with such fixes, it is still better I think, to update the existing source package from the Ubuntu archive using the new version of the app/library, and building it in a PPA. This keeps things upgradable from the distro, and doesn't potentially leave files lying around the system, which can cause problems.
    – dobey
    Jul 2, 2012 at 15:41
  • I hardily agree with all that you have said. I was just mentioning it, because the OP did not explicitly specify whether they were talking about the same version or not.
    – reverendj1
    Jul 2, 2012 at 15:52

You will not get any performance boost if you recompile things on your system, unless your Ubuntu is highly customized, like using a lot of core libraries from another source.

The trick is that all packaged for Ubuntu are build on a real Ubuntu system, which uses the same packages at yours. That means that the building environment is 100% the same system, all libraries have identical bindings etc, only user config differs. Because of that, when binary packages are build, a lot of aggressive optimization can be applied, and they will be still valid on your system. This way Ubuntu can provide users with packages whose performance is maximized.

The chance that packages you compile on your own will have better performance is very low. It's even probable that they will be working slower, because a lot of optimization which is not enabled by default is manually triggered when building packages for Ubuntu repositories.

Concerning stability, the reasoning is the same. Because packages are build on an Ubuntu system, which has exactly the same libraries as you do (provided you got them from repositories), there will be no difference in their behavior.

Concluding, do not expect any profits when building apps on your own.

However, if you use custom, modified libraries or core packages, that do not originate from Ubuntu repositories, it may be beneficial to rebuild applications which use them. However, most probably the difference will be so small that difficult to notice, so it may be not worth the hassle.


I am a statistician who works in R. I am using a dual-boot system (Ubuntu/Windows 7). When I installed R from the Ubuntu repository (r-base, r-base-dev, ...), its performance was terrible! The time it took to run a certain script (calculate the trajectory of a particle in a loop) was 50% longer than on Windows! Disheartened, I purged the version of R supplied by Ubuntu and compiled my own with "-march=native -O3" flags for all compilers (CFLAGS, CXXFLAGS, FFLAGS, OBJCFLAGS, FCFLAGS), and the result was... impressive to say the least. My scripts were running twice as fast as on Windows 7. Besides that, sometimes, official repositories contain prehistoric versions of libraries, and a developer might want to compile fresh libraries every time.

Besides that, I also compiled the Linux kernel, but the gains were much more modest (5%). So it really depends on the software, how much it gains by using your native architecture etc. Some chess engines (like Stockfish) rely on sse and popcnt instructions, so if the default compiled binary—jack of all processors, master of the oldest—does not support the cool new stuff your processor is capable of, consider compiling it.


Generally no, but there are exceptions here and there.

  1. Compiling Firefox 18 from source with flags "-march=native -pipe -O2" seemed to decrease those little periods of unresponsiveness during page loads, but nothing else changed. Compiling it with flags "-march=native -pipe -Os" made it 16.5MB smaller in RAM. It launched noticably faster as a consequence, and seems to take up less RAM with 30+ tabs open, but all the menu options seemed to take forever.
  2. Compiling OpenArena from source with flags "-march=native -pipe -O2" increased avg framerate from 28.7 (timedemo results) to 33.4 over install from repository. That's a big improvement.

Everything else I've compiled from source either has , runs roughly the same, or sometimes breaks/runs like crap.


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .