[ccache] Why not cache compile failures?

Andrew Stubbs ams at codesourcery.com
Tue Sep 18 09:58:44 MDT 2012

On 18/09/12 15:34, Justin Lebar wrote:
>> I'm looking at ways to improve compile speed, and one obvious option is to
>> cache compile failures. I'm thinking of certain non-called-for-link autoconf
>> tests, in particular.
> Doesn't autoconf have a cache of its own?

Yes, but only for repeated config tests, and for incremental configures; 
it doesn't help you for clean rebuilds. You can take a copy of the 
cache, and reload it in your rebuild, but that prevents it actually 
checking if the result would change, which ccache would do.

> Anyway, ccache makes running the compiler faster.  In the cause of
> giving the compiler a small program to compile to test a feature,
> surely running the compiler takes virtually zero time, and the
> overhead is elsewhere.

OK, what I haven't said is that in the system I'm working with a cache 
miss is quite expensive. I'm using something like distcc (but not 
distcc), for a somewhat unusual setup we have.

As a proportion, a cache miss on a small compile task is more expensive 
than a large compile task. If you watch a build log scroll by you can 
actually see it pause when it gets a cache miss. It doesn't help that 
even in a parallel make the configure script tends to be serial. This is 
why I'm trying to mop up all the small jobs.


More information about the ccache mailing list