Skip to content

GHA: ccache not efficient? #116975

Description

@pitrou

Bug description:

  1. If you look at the ccache stats in ccache-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

ccache stats
  /usr/bin/ccache -s
  Summary:
    Hits:              52 /  341 (15.25 %)
      Direct:          30 /  343 (8.75 %)
      Preprocessed:    22 /  313 (7.03 %)
    Misses:           289
      Direct:         313
      Preprocessed:   291
    Uncacheable:      104
  Primary storage:
    Hits:             387 /  685 (56.50 %)
    Misses:           298
    Cache size (GB): 0.18 / 0.20 (90.22 %)
    Cleanups:           8

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.

  1. The "Post Configure ccache action" step itself takes ~2 minutes (this seems unexpected), which is as long as it takes to compile CPython. So it's not obvious there is a benefit at all, even if the problem above was fixed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    infraCI, GitHub Actions, buildbots, Dependabot, etc.type-bugAn unexpected behavior, bug, or error

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions