FYI: ccache for MSVC/Windows

Luboš Luňák l.lunak at
Thu Nov 18 21:10:38 UTC 2021

On Wednesday 17 of November 2021, Thorsten Behrens wrote:
> Note that ccache performs surprisingly poor on io-starved Windows
> setups [1], which possibly is true for the Jenkins VMs.

 If I run 'CCACHE_DEBUG=1 make -C starmath -j8 -rs Library_sm', most of the 
ccache log files claim the full ccache invocation took roughly 50ms. With ~50 
source files in Library_sm that should be ~2.5s CPU time, and if we count 
only non-HT cores, that should take less than a second. Yet the time spent by 
building .cxx files is roughly 3 seconds. So I wouldn't be that certain in 
claiming it's about ccache performing poorly, maybe it's gbuild or poor 
Windows performance when invoking executables or whatever.

 And if I run the above with GBUILD_TRACE set, I get what's attached. 
Apparently even outputting those log 109 lines pretty much doubles the CXX 
time, for whatever strange reason, and there are quite some empty spaces 
between the compilations (they are also in a log created on linux, but there 
they are tiny). I guess that's the reason why we used to have a gmake version 
patched for Windows.

> Along the same line, I've also recently added support for sccache, but
> YMMV there, too (I'd choose ccache over sccache for local caches any
> time). Might be interesting for our dev mentoring team though, since
> sccache enables sharing of cache content via hyperscaler blob storage
> [2].

 Recent ccache versions have support for shared remote storage too, although 
I've never tried it. I've never tried sccache either, but just from looking 
at it ccache seems generally superior, for example sccache can't handle PCHs, 
so it's basically trading one speedup for another.

 Luboš Luňák
 l.lunak at
-------------- next part --------------
A non-text attachment was scrubbed...
Name: gbuild_trace_windows.png
Type: image/png
Size: 14511 bytes
Desc: not available
URL: <>

More information about the LibreOffice mailing list