Hello,
I've enabled ccache[0] in
https://github.com/wxWidgets/wxWidgets/pull/2571,
however this wasn't such an obvious gain as I hoped it would be.
Here are the selected build times for a CI run just before this commit[1],
the first CI run after adding ccache[2], i.e. without any cache yet, and
another CI run[3] immediately afterwards, i.e. without any changes to the
sources, resulting in 99% cache hit rate:
CI run | wxX11 | wxGTK2 | wxGTK3 STL | Total |
----------|-------|--------|------------|-------|
No ccache | 7.5 | 14 | 21 | 21.5 |
100% miss | 14 | 19 | 25.5 | 26 |
99% hit | 6.5 | 8 | 8.5 | 11 |
(times are in minutes, rounded).
As you can see, using ccache does result in noticeable gains when we don't
actually need to recompile anything, but it also has huge negative effect
when the cache is being populated, which is much bigger than what I would
have naively expected. I don't know if it's possible to reduce it by
tweaking ccache options (using "direct mode" only?) or even if we care
about it, i.e. whether the extra overhead will ever be so big again.
Does anybody here have more experience of using ccache with wxWidgets?
I've stopped using it myself many years ago because it didn't work well
with the precompiled headers we still used back then and didn't start using
it again even when we disabled the use of PCH by default with gcc, so I'm
not sure if it's worth it, but it would seem that it could still be useful
for the CI builds, which often run even if nothing much has been changed.
Thanks,
VZ
[0]:
https://github.com/wxWidgets/wxWidgets/pull/2571/commits/9320aeb28bb639b99d3bd3545568334237d76fee
[1]:
https://github.com/wxWidgets/wxWidgets/actions/runs/1391857016
[2]:
https://github.com/wxWidgets/wxWidgets/actions/runs/1391955314
[3]:
https://github.com/wxWidgets/wxWidgets/actions/runs/1392059407