compiling – What’s ccache? When ought to I take advantage of it when constructing and reviewing Bitcoin Core PRs?

0
61


ccache is a compiler cache.

It accelerates recompilation by caching earlier compilations and detecting when the identical compilation is being achieved once more.

Not like dbcache the choice of how a lot ccache to allocate just isn’t as crucial. The Bitcoin Core productiveness doc does suggest that you just put one thing like this in ~/.ccache/ccache.conf:

max_size = 50.0G  # or no matter cache measurement you favor; default is 5G; 0 means limitless

base_dir = /residence/yourname  # or wherever you retain your supply information

Be aware: base_dir is required for ccache to share cached compiles of the
identical file throughout completely different repositories / paths; it can solely do that
for paths beneath base_dir. So this feature is required for efficient use
of ccache with git worktrees.

You should not set base_dir to “/”, or anyplace that accommodates system
headers (based on the ccache docs).

There would 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 could, and sometimes
do, introduce options that ccache cannot foresee.

and

The quickest mode (the “direct mode”) has a nook case which can lead to false optimistic cache hits.

Usually although it seems you’ll be able to simply set up it (as Pieter says) and overlook about it and this may prevent time on compiling Bitcoin Core PRs.

For different info on dashing up C++ compilation see this glorious weblog submit from Martin Hořeňovský.

LEAVE A REPLY

Please enter your comment!
Please enter your name here