Open pitrou opened 3 months ago
@hugovk
cc @encukou and @erlend-aasland who've also been looking into ccache (https://github.com/python/cpython/issues/113858).
Time in seconds for each step:
Step | with ccache | without ccache |
---|---|---|
Set up job | 1 | 1 |
Run actions/checkout@v4 | 5 | 5 |
Runner image version | 0 | 0 |
Restore config.cache | 0 | 0 |
Install Dependencies | 18 | 80 |
TSAN Option Setup | 0 | 0 |
Add ccache to PATH | 0 | 0 |
Configure ccache action | 2 | n/a |
Configure CPython | 4 | 79 |
Build CPython | 97 | 93 |
Display build info | 5 | 7 |
Tests | 130 | 125 |
Post Configure ccache action | 136 | n/a |
Post Restore config.cache | 0 | 0 |
Post Run actions/checkout@v4 | 0 | 0 |
Complete job | 0 | 0 |
Total | 398 | 390 |
The "Install Dependencies" 18s vs 80s looks unrelated, so the total without ccache could be seen here as ~330s instead of 390s?
Let's just look at ccache/configure steps:
So with ccache costs an extra ~63s over without cccache.
By the way, the slowness of the "Post Configure ccache action" doesn't match our experience on Apache Arrow, where saving a 1GB ccache can take 20 seconds. Example here with the "Post Cache Docker Volumes" step: https://github.com/apache/arrow/actions/runs/8329904897/job/22793369592
Instead of using hendrikmuhs/ccache-action
, you might look into using the cache action directly. Setting up ccache is not difficult.
Bug description:
ccache
stats inccache
-enabled Github Actions jobs, you'll notice that the cache seems hardly useful most of the time, as there are few hits and many misses.Example here: https://github.com/python/cpython/actions/runs/8332366775/job/22801352882
Most likely this is because all those builds clash for the same cache keys even though they use different compiler options. The solution would be to use per-build cache keys.