Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

when is the case to use ccache?

Tags:

ccache

As far as I know, ccache speed up compilation by catching previous compilations and detecting when the same compilation is being done again. however, makefile do the same thing. so why should we need ccache? when is the case we use it? thanks!

like image 633
chicklet Avatar asked Apr 13 '12 07:04

chicklet


1 Answers

From http://ccache.samba.org/:

If you ever run make clean; make, you can probably benefit from ccache. It is common for developers to do a clean build of a project for a whole host of reasons, and this throws away all the information from your previous compilations. By using ccache, recompilation goes much faster.

Another reason to use ccache is that the same cache is used for builds in different directories. If you have several versions or branches of a software stored in different directories, many of the object files in a build directory can probably be taken from the cache even if they were compiled for another version or branch.

A third scenario is using ccache to speed up clean builds performed by servers or build farms that regularly check that the code is buildable.

You can also share the cache between users, which can be very useful on shared compilation servers.

like image 132
Delan Azabani Avatar answered Oct 03 '22 00:10

Delan Azabani