Repository navigation
ci: cache vizd objects in the Windows build - #207
Conversation
windows-release.yml cached Boost and OpenSSL but compiled vizd itself from scratch on every push to master: "Build vizd" is ~18 of the ~24 min job, while the Linux Docker build with ccache restored hits 85-87%. Install mingw-w64-ucrt-x86_64-ccache, point CMake's compiler launcher at it, and save CCACHE_DIR (under RUNNER_TEMP, outside the workspace) per commit with a prefix restore key. CCACHE_COMPILERCHECK=content because setup-msys2 reinstalls GCC on every run, which changes its mtime and would turn every lookup into a miss. ccache -z before the build and -s after, so the log shows this run's hit rate only. Build flags, targets and the release step are unchanged.
|
Two real runs on
Cold is a bit slower than the usual ~18 min because every TU also goes through ccache once. The cache entry is 34 MB. The warm number is the best case (same commit); a real master push with a few changed files lands in between. |
|
Measured the effect on the same commit (
That is a 5.2× speedup, and it is not an artefact of a skipped build: the log shows 171 For comparison, the four most recent One thing worth pairing with #206: the saved ccache entry is 32 MiB per commit-key ( No objection from me on the substance — the key/restore-key pair is correct (per-commit key, prefix restore, |
On1x
left a comment
There was a problem hiding this comment.
Checked the same-commit measurement in the thread: Build vizd went 21m09s cold → 26s warm on 621fc409, with ccache hit numbers printed by the run itself. CCACHE_COMPILERCHECK=content is the right choice given setup-msys2 reinstalls the toolchain every run, and CCACHE_DIR outside the workspace keeps the checkout clean. Build flags, targets, bundle and release step are unchanged; the workflow only publishes on master.
windows-release.ymlcaches Boost and OpenSSL but compiles vizd itself from scratch on every push to master. Build vizd is ~18 of the ~24 min job (last three master runs: 23–24 min).Change (
.github/workflows/windows-release.ymlonly):mingw-w64-ucrt-x86_64-ccacheand set it as CMake's C/CXX compiler launcher;CCACHE_DIRunderRUNNER_TEMP(outside the workspace), saved per commit (windows-ccache-mingw-ucrt64-<sha>) and restored from the newest prefix match,CCACHE_MAXSIZE=1G;CCACHE_COMPILERCHECK=content:setup-msys2reinstalls GCC on every run, which changes its mtime, and the default mtime check would make every lookup a miss;ccache -zbefore the build andccache -safter, so the log shows this run's hit rate.Build flags, targets, the bundle and the release step are unchanged.
Testing: this workflow doesn't run on PRs. It runs on pushes to
masterandwindows_build, and onlymasterpublishes a release. I fast-forwardedwindows_build(untouched since #116, 505 commits behind) to this commit, so it gets a real Windows run that builds everything but publishes nothing. I'll run it twice, cold and then warm, and post both timings and theccache -soutput here.