I recently tried and adopted
ccache, which (quoting its
webpage)
acts as a caching pre-processor to C/C++ compilers, using
the -E compiler switch and a hash to detect when a compilation can be
satisfied from cache. This often results in a 5 to 10 times speedup in
common compilations.
I must say I was sceptical, but ccache really works great, specially
when you have to compile again and again the same code, like a Debian
package which you have to clean but which source code remained the
same.
The only glitch is installation. If you wish to use it by default for
all your compilers, there is still some manual configuration. I'd
really like it to provide an alternative to, say, cc.