Skip to content
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

How many bits tinyLFU uses to count access frequency? #335

Open
Millione opened this issue Mar 30, 2023 · 1 comment
Open

How many bits tinyLFU uses to count access frequency? #335

Millione opened this issue Mar 30, 2023 · 1 comment

Comments

@Millione
Copy link

I found the explanation difference between code comments and README. It confuses me.

ristretto/policy.go

Lines 366 to 374 in 3177d9c

// tinyLFU is an admission helper that keeps track of access frequency using
// tiny (4-bit) counters in the form of a count-min sketch.
// tinyLFU is NOT thread safe.
type tinyLFU struct {
freq *cmSketch
door *z.Bloom
incrs int64
resetAt int64
}

* **Admission: TinyLFU** - extra performance with little memory overhead (12 bits per counter).

@all-seeing-code
Copy link
Contributor

Hi @Millione Thanks for highlighting, we will take a look at this. Looks like a mismatch between the implementation and the docs. I have added it to our internal tracker, we will update you here. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants