New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve linkage cache linkage_cache_performance #8695
Improve linkage cache linkage_cache_performance #8695
Conversation
- Use reference counting so nested `CacheStoreDatabase.use` share the same underlying database (rather than rereading it every time). - Only write out the cache database file when it has changed. - Cleanup cache database entries on formula or full `brew cleanup`. Fixes #8690
With this branch, performance of I do notice that the performance at this stage is still moderately worse than having no cache at all - I wonder if we've got more gains to be made. It could also be that the way we're handling this means that we have performance gains from caching with small numbers of formulae installed, but at certain cache sizes performance ends up actually being better without a cache. |
return_value | ||
end | ||
|
||
# Sets a value in the underlying database (and creates it if necessary). | ||
def set(key, value) | ||
dirty! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SCNR @MikeMcQuaid
Thank you @MikeMcQuaid. That performance gain is immensely helpful! |
Thanks for testing @mistydemeo!
Yeh, there's definitely improvement to be had here although it's likely very dependent on your disk IO (doing this on an spinning platter HDD will take a lot longer to be slower, from previous measurements). The reference counting I've added here should mean you can wrap multiple calls to e.g. |
CacheStoreDatabase.use
share the same underlying database (rather than rereading it every time).brew cleanup
.Fixes #8690
brew style
with your changes locally?brew tests
with your changes locally?