Many people, especially around gentoo linux, do think that ccache is a must-have, reducing compile time pretty much. But is that really true? How much does it really help?
Let’s nail it down with some facts:
ccache parses the compiler call to make sure it’s a single compile as it doesn’t work with linking or multi-source builds (for you nerds out there, I intentionally left out -fwhole-program). As soon as ccache is sure it’s compiling one file, the compiler gets kicked off for preprocessing and the result is saved to a temp. place. This result is being hashed with md4 and then being compared to what we have on disk. If the md4 sum is found, the compiled result is delivered back. Otherwise the compiler gets some work to do.