-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
LFU Cache Fixes #7479
LFU Cache Fixes #7479
Conversation
The existing API for the Bloom Filter constructor was, huh, not ideal. There is no need to use variable args and check the values of the args for their meaning. Signed-off-by: Vicent Marti <vmg@strn.cat>
Signed-off-by: Vicent Marti <vmg@strn.cat>
Signed-off-by: Vicent Marti <vmg@strn.cat>
Signed-off-by: Vicent Marti <vmg@strn.cat>
the '==' operator is not posix; you're supposed to use a single '=' Signed-off-by: Vicent Marti <vmg@strn.cat>
One thing I missed while reviewing the earlier PR was the names of the flags:
There is no need to prefix the flag names with |
Signed-off-by: Vicent Marti <vmg@strn.cat>
@deepthi: |
Signed-off-by: Vicent Marti <vmg@strn.cat>
Signed-off-by: Vicent Marti <vmg@strn.cat>
OK, fixed and fixed all the flappy tests. I think this PR, which enables the LFU cache by default, is ready to merge. ✨ |
Oops, I did not realize that one of the flags was already there. I would not hold up this PR. We can rename the flags in a backwards-compatible way in a separate PR (if we decide it is worth doing). |
@@ -76,5 +76,5 @@ type Config struct { | |||
var DefaultConfig = &Config{ | |||
MaxEntries: 5000, | |||
MaxMemoryUsage: 32 * 1024 * 1024, | |||
LFU: false, | |||
LFU: true, |
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.
👍
return uint64(size), uint64(locs) | ||
// NewBloomFilterWithErrorRate returns a new bloomfilter with optimal size for the given | ||
// error rate | ||
func NewBloomFilterWithErrorRate(numEntries uint64, wrongs float64) *Bloom { |
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.
👍
Signed-off-by: Vicent Marti <vmg@strn.cat>
Description
Some bug fixes, refactorings and more benchmarks for the LFU implementation. Getting it in better shape before we switch to it by default.
Related Issue(s)
Checklist
Deployment Notes
Impacted Areas in Vitess
Components that this PR will affect: