Speed Up Your Compilation Times Part Two: Using ccache

In my last post I presented a technique for speeding up compilation times in a very limited number of a cases. The obvious question is then what about the rest of the time? Enter ccache. ccache is a compiler cache which is to say that if you request it to compile a file with the exact same preprocessor directives and compiler flags then the result from the cache will be used. I use this tool everyday and I highly recommend it.

For the nervous among you who are worried that ccache will produce results inconsistent with those from just using the compiler, I present this choice quote from the ccache site:

“The most important aspect of a compiler cache is to always produce exactly the same output that the real compiler would produce.”

If my recommendation and the assurances of the ccache site aren’t enough to convince you, I suggest you test it for yourself. I am positive you’ll find it works as advertised and that the decrease in compilation times will convince you to continue to use it.

Leave a Reply