golang-lru icon indicating copy to clipboard operation
golang-lru copied to clipboard

Proposal to Integrate SIEVE Eviction Algorithm

Open yazhuo opened this issue 1 year ago • 11 comments

Hi there,

Our team (@1a1a11a) has developed a new cache eviction algorithm, called SIEVE. It’s simple, efficient, and scalable.

Why SIEVE could be a great addition:

  • Simplicity: Integrating SIEVE is straightforward, usually needing to change less than 20 lines of code on average.
  • Efficiency: On skewed workloads, which are typical in web caching scenarios, SIEVE is top-notch.
  • Cache Primitive: SIEVE is not just another algorithm; it's a primitive that could enhance or replace LRU/FIFO queues in advanced systems like LeCaR, TwoQ, ARC, and S3-FIFO.

Welcome to dive into the details on our website sievecache.com and on our SIEVE blog.

We would love to explore the possibility of integrating SIEVE into golang-lru. We believe it could be a beneficial addition to the library and the community.

Looking forward to your feedback!

yazhuo avatar Dec 25 '23 21:12 yazhuo

I have been using golang-lru repo for many years now. Thanks everyone who contributed.

I read the Sieve paper and it is super cool. I would like to volunteer to integrate sieve into golang-lru.

Thanks!

cc - @yazhuo

venkatsvpr avatar Jan 15 '24 20:01 venkatsvpr

Awesome! Let us know if you need any help or have any question. :)

1a1a11a avatar Jan 15 '24 20:01 1a1a11a

@venkatsvpr Great to hear from you! Thanks for your support.

Btw, I think it might be better to integrate SIEVE in an opt-in manner.

yazhuo avatar Jan 15 '24 20:01 yazhuo

Thanks @1a1a11a @yazhuo

Yes - Agree!

venkatsvpr avatar Jan 15 '24 20:01 venkatsvpr

Hi folks, @irenarindos @mgaffney @paskal

Want to touch base with you to see if the proposal make sense to you.

Thanks!

venkatsvpr avatar Jan 16 '24 00:01 venkatsvpr

Hi!

We are interested in seeing a more detailed proposal. Keep in mind that any proposed changes should not change the default behavior or characteristics of the current v2 implementation (meaning using SIEVE would have to be optional). We could then gather feedback from users and consider making it the default in the next revision (v3).

mgaffney avatar Jan 16 '24 21:01 mgaffney

Hi @mgaffney Thanks for getting back.

I have added two New methods (NewSieve and NewSieveWithEvict) which would work with SIEVE evicition.

Please take a look at this PR and add your comments.

venkatsvpr avatar Jan 16 '24 22:01 venkatsvpr

@venkatsvpr that PR is not for this repo

mgaffney avatar Jan 17 '24 23:01 mgaffney

Yes. Let me complete the PR and send out another PR for this repo. Thanks!

venkatsvpr avatar Jan 18 '24 02:01 venkatsvpr

I've updated the PR https://github.com/hashicorp/golang-lru/pull/169

Please take a look.mgaffney

Also, if & when there is a v3 version, It'd be great with the change the New signature. This would make us future proof the new changes we might have. (like sieve)

venkatsvpr avatar Jan 25 '24 04:01 venkatsvpr

@mgaffney Did you get a chance to check out the PR #169
Let me know if I can be of any help.

Thanks!

venkatsvpr avatar Feb 05 '24 17:02 venkatsvpr