Changes

Jump to: navigation, search

Improving Build Times

1,293 bytes added, 12:09, 12 February 2008
Using a compiler cache
Using the value '''4''' is a safe default on most dual core systems. Even on a single core machine, a value of '''j2''' is a reasonable choice so that make isn't constantly blocked on I/O bound operations. You can experiment with different numbers of jobs for your particular hardware configuration.
 
== Suppressing compiler output on the console ==
 
Normally, make prints a lot of information to the console. While this information is helpful for debugging compilation errors, it tends to slow down compile time. You can ask that make suppress this output, to be '''silent''' by means of the '''-s''' switch:
 
make -s -f client.mk
 
== Using a compiler cache ==
 
Using a compiler cache, source code can be compiled once and stored in a disk cache, thereby eliminating the need to compile it again in future. One such tool is [http://ccache.samba.org/ ccache], which uses hashes to determine if previously cached compiler output can replace a subsequent compilation. According to its developers, ccache "often results in a 5 to 10 times speedup in common compilations."
 
Usinc ccache for Mozilla development is a safe and effective way to reduce build times on Linux and Mac OS X.
 
=== Linux ===
 
==== Ubuntu ====
 
On Ubuntu, simply install the '''ccache''' package:
 
sudo apt-get install ccache
 
=== Mac OS X ===
 
On Mac you can use [http://www.macports.org/ MacPorts] to install ccache:
 
sudo port install ccache
After installing, you will need to symlink your compilers in order to have them work with ccache:
 
for X in cc gcc g++ c++ ; do ln -s /usr/bin/$X /opt/local/bin ; done

Navigation menu