matus-chochlik / ctcache

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

Further reduce stats lock contention #47

Closed bartdesmet closed 7 months ago

bartdesmet commented 7 months ago

Avoid duplicate file open/close activity in the common case of updating the stats file under the lock. Instead, check if the file exists and open it with r+ mode to make in-place edits. Otherwise, if the file does not exist, open it with w mode to write the initial stats.

matus-chochlik commented 7 months ago

Thanks for the PR

bartdesmet commented 7 months ago

Linking issue https://github.com/matus-chochlik/ctcache/issues/36