Cache misses are extremely expensive.

Guillaume Campagna <[email protected]> Thu, 23 Jun 2016 15:14:51 -0400
Newsgroups gmane.comp.compilers.ccache
Message-ID <[email protected]>
Hi, 

Just started using ccache based on this tutorial and so far I like it. However, caches miss being extremely slow. Here are my results : 

Regular clean build without ccache : 1m40s
First build with ccache : 4m36s
Second build with ccache : 30s

I’m not sure where to start debugging. The performance page (https://ccache.samba.org/performance.html) mentions how complexity of the make file can slow down compilation, but in this context I use Xcode so call of ccache should be relatively quick. I was expecting some performance decrease, but not this much!

There are my current settings using version 3.2.5 : 

export CCACHE_MAXSIZE=3G
export CCACHE_HARDLINK=true
export CCACHE_SLOPPINESS=pch_defines,file_macro,time_macros,include_file_mtime,include_file_ctime,file_stat_matches

Note that I do use a pch, if that changes something. 

Thanks for any pointers!