matus-chochlik / ctcache

Cache for clang-tidy static analysis results
Boost Software License 1.0
79 stars 28 forks source link

Avoid repeated recalculation of stats file name #55

Closed bartdesmet closed 4 months ago

bartdesmet commented 4 months ago

I was looking into https://github.com/matus-chochlik/ctcache/issues/36 again as it showed up in our CI build system recently. This PR has a minor tweak.

The better approach would likely be to move away from the single lock and maybe use the digest[:2]-based paths to keep hit/miss stats for each of the 256 buckets. This reduces the contention in the (frequent) update path, at the expense of the (infrequent) read and clear paths having to enumerate the folders.

bartdesmet commented 4 months ago

@matus-chochlik If you think https://github.com/matus-chochlik/ctcache/pull/56 is reasonable, this can be closed.