I'm using this day off to do my host OS updates a bit early. Main focus is looking at the CCache perf on my Gentoo desktop system.

This is now my second update cycle using CCache with Gentoo, and at least right now I'm not too impressed. Hit rates are hovering somewhere around 10%. Packages like LLVM or Clang, which were build both last time and this time, were not sped up at all.

And yet...I'm now sitting here considering how hard it would be to write a librados CCache backend. 🤦

#Gentoo

@mmeier this might help a little https://blogs.gentoo.org/mgorny/2017/07/23/optimizing-ccache-using-per-package-caches/ along with a `export CCACHE_BASEDIR=${PORTAGE_TMPDIR}/portage` from https://bugs.gentoo.org/346063

#linus #Gentoo

Optimizing ccache using per-package caches

ccache can be of great assistance to Gentoo developers and users who frequently end up rebuilding similar versions of packages. By providing a caching compiler frontend, it can speed up builds by r…

Michał Górny

@mmeier You might find additional info from https://codeberg.org/zyxhere/etc-portage/issues/1

TLDR; For the above to work you also need CCACHE_DIR set in make.conf

Make `FEATURES=ccache` work by default

From `README.md`: ``` The above assumes you have CCACHE_DIR=/var/cache/ccache in make.conf. The FEATURES=ccache invokes ccache before bashrc has time to run, causing ccache to use /var/tmp/ccache (if $CCACHE_DIR is not set already and it also ignore /etc/ccache.conf) instead resulting in permis...

Codeberg.org

@zyx Yupp, I had alread set the CCACHE_DIR because I wanted it on a remote disk. And it's 300 GB max size, because I really don't want to care about file getting thrown out prematurely. Now looking at about 3.5 GB size after two system updates, I might have been a bit biased by our builds in $DAYJOB with that size setting.

But the CCACHE_BASEDIR is a good point, that might have something to do with it.

Thanks for the tips!