syndtr / goleveldb

LevelDB key/value database in Go.
BSD 2-Clause "Simplified" License
6.15k stars 968 forks source link

ARC cache implementation #186

Open vtolstov opened 6 years ago

vtolstov commented 6 years ago

Does it possible to create ARC cache implementation?

dgryski commented 6 years ago

Sadly ARC is patented. CLOCK-Pro or TinyLFU are both patent-free, faster, and give higher hit ratios.

I have implementations here: https://github.com/dgryski/go-clockpro and https://github.com/dgryski/go-tinylfu

vtolstov commented 6 years ago

Thanks! i'm try to check you links

vtolstov commented 6 years ago

@dgryski sadly this packages not provide onEvict interface to notify about evicted items =(

dgryski commented 6 years ago

Patches accepted :D

dgryski commented 6 years ago

I've added two issues (one for go-tinylfu, one for go-clockpro) to add OnEvict handlers.

vtolstov commented 6 years ago

Thanks!