Status of ccache

Magnus Ihse Bursie magnus.ihse.bursie at
Mon May 25 07:44:26 UTC 2015

On 2015-05-22 17:47, Dan Smith wrote:
> JDK-8027584 disabled ccache by default, I gather because it doesn't work in Cygwin, and secondarily because of vague general problems with it.
> The documentation (README-builds.html) still unambiguously endorses it, although doesn't say anything about how to turn it on (configure with --enable-ccache).
> I'm curious about the current state of affairs, and suggest updating the documentation to reflect the answer.

Ccache is an improvement in some situation, but most often not. 
Especially the hotspot build performance can be affected by ccache 
presense or absense.

There are two major knobs to turn for tuning hotspot build performance: 
precompiled headers, and ccache. The only general rule I can give is:
1) do not use both at the same time, that is more or less always a loss
2) you need to test both for your specific workflow, and measure, to see 
which is best for you

Factors affecting the performance include:
1) Your typical workflow: do you recompile often? From different repos? 
Do you typically do incremental rebuilds or builds from scratch (like a 
Hudson build server)?
2) Your OS
3) Your hardware, and not just like "x86 system" but very specific 
hardware aspects of CPU, bus, memory and disk can alter the performance 

In short: since ccache does not give everyone a performance benefit all 
the time, and carries with it risk of complication, we default by having 
it turned off. Precompiled headers are currently on by default, but 
there are discussions in the hotspot team to change that default as well.

The build documentation is sadly outdated in several aspects. :-(


More information about the build-dev mailing list