Repository navigation
CI is slow: ccache is not effective, ideas to speed it up #2917
ganeshgore
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
The master CI (
build.yml) takes 2-3 hours per run, and one run on 2026-11-13 took 8h46m. This is an analysis of where the time goes and what could speed it up. It is based on the weekly scheduled run of 2026-11-29 and the repo's current cache state.What the data shows
Buildstep takes 60-107 minutes. The Ubuntu installer takes 108 minutes, and the Ubuntu 22.04 build variants 56-69 minutes. Install, checkout and test steps take minutes. Each of the ~14 Ubuntu 22.04 variants rebuilds the whole tree (Yosys, VTR, ABC and OpenFPGA) on a 4-core runner.Build: GCC-12job had 0 hits out of 8118 compiles, and the log saysNo cache found.max-sizeis 500MB, the cache was 89% full, and ccache logged 54 cleanups, so it evicts entries during the build.linux_build, so wall time is roughly 65 minutes plus up to 28 minutes of tests.ccache -svwould show it.Possible improvements, most effective first
max-sizeto about 1.5-2GB for the heavy jobs. Save caches only on master (save: ${{ github.ref == 'refs/heads/master' }}) and let PRs restore from master, which keeps the cache count bounded and makes master caches survive. A warm cache typically cuts these builds from ~60 to 10-15 minutes.w/o test,w/o SWIG,w/o version number,std::getline,libedit,w/o Yosys,capnproto update). Run the full set only on master and the weekly schedule. On PRs, run a small subset such as GCC-12 plus one Clang or other-OS build.linux_installer(108 min) repeats the work oflinux_build. Reuse its output via an artifact, or share the ccache key.timeout-minutesto jobs so a hang fails fast, and runccache -svin CI to diagnose the uncacheable compiles.I would start with items 1 and 2, which are small workflow changes with the largest payoff. Feedback welcome, especially on which matrix variants must run on every PR.
All reactions