-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
#10: Feat - LFU cache implementation with approximate counting. #476
#10: Feat - LFU cache implementation with approximate counting. #476
Conversation
@JyotinderSingh please have a look. TIA! |
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.
Thanks for introducing a new eviction algorithm to Dice @Rits1272! Please add comprehensive tests for these changes.
@Rits1272 Please squash your commits before you push. You can do this once all changes are done. |
Hey @Rits1272, could you please address the comments and fix any conflicts? This PR has been open a while, let's try to get it merged. |
@JyotinderSingh didn't get time this week, but will work on adding test cases, resolving conflicts and comments by this weekend |
@JyotinderSingh apologies for the delay. I have added test cases, please review |
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.
Thanks for adding support for LFU eviction algorithm, @Rits1272! The changes look good.
Approved
Fixes #10
How LFU cache is implemented?
access
counter of a key is piggybacked to theLastAccessedAt
field in Dice Obj defined here. The first 8 bits is allocated to maintaining the access counter and the last 24 bits are allocated to maintaining the last access time of a keyaccess
counter is an approximate counter which is incremented logarithmicallydecay
mechanism as of yet.Issue: #10