[ccache] Stumbling blocks with ccache and embedded/encapsulated environments

Paul Smith paul at mad-scientist.net
Wed Nov 10 17:24:38 MST 2010

On Wed, 2010-11-10 at 15:56 -0800, Christopher Tate wrote:
> Very short version:  if your 'make' dependencies or equivalent are
> well-written, using ccache will almost always *increase* your
> incremental build times.  This wasn't immediately obvious to us but
> makes sense in hindsight: if your dependencies are well constructed,
> then when you run 'make' it won't try to build something unless it
> really has changed.  We see *very* few ccache hits over time when
> doing incremental builds.

Yes, I believe that.  Our code is probably on the cusp so I'll do some
testing.  We do have very good dependency recognition.

However, what I was really hoping for was to gain advantage by
leveraging the cache across multiple _workspaces_, not necessarily
incremental builds within the same workspace.

If I have 2 workspaces and I update and build one of them, then go
update and build the other which shares a good portion of the same code,
then my hope was I could leverage the cache to make the second build
much faster by avoiding recompilation (we do have a lot of too large,
pretty gnarly C++ source files that take a while to compile, especially
with optimization enabled).  Because we support many (too many!)
parallel lines of development we're often moving workspaces around back
and forth; something that could improve build times in these cases would
be welcome.

But we will need to measure this, to be sure, to see if the cost during
the more common incremental builds pays for the savings during larger,
"updated workspace" builds.

Thanks for that note; I hadn't quite considered it that way!

More information about the ccache mailing list