matus-chochlik / ctcache

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

Avoid repeated recalculation of stats file name #55

Closed bartdesmet closed 7 months ago

bartdesmet commented 7 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 7 months ago

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