bitcoincore growth – What’s ccache? When ought to I exploit it when constructing and reviewing Bitcoin Core PRs?
ccache is a compiler cache.
It quickens recompilation by caching earlier compilations and detecting when the identical compilation is being performed once more.
In contrast to dbcache the choice of how a lot ccache to allocate is just not as essential. The Bitcoin Core productiveness doc does advocate that you simply put one thing like this in
max_size = 50.0G # or no matter cache dimension you favor; default is 5G; 0 means limitless base_dir = /house/yourname # or wherever you retain your supply recordsdata
Notice: base_dir is required for ccache to share cached compiles of the
identical file throughout totally different repositories / paths; it would solely do that
for paths beneath base_dir. So this selection is required for efficient use
of ccache with git worktrees.
You will need to not set base_dir to “/”, or anyplace that comprises system
headers (in response to the ccache docs).
There does not look like any apparent downsides to make use of
ccache. However there are a few warnings on the ccache website.
Compilers are transferring targets. Newer compiler variations might, and sometimes
do, introduce options that ccache cannot foresee.
The quickest mode (the “direct mode”) has a nook case which may end up in false optimistic cache hits.
Usually although it seems you’ll be able to simply set up it (as Pieter says) and neglect about it and this may prevent time on compiling Bitcoin Core PRs.
For different info on dashing up C++ compilation see this wonderful weblog submit from Martin Hořeňovský.