Hacker News new | ask | show | jobs
by cyri 2374 days ago
Have a look at, also in Go written, https://github.com/dgraph-io/ristretto which out performs bigcache and freecache (see the colourful graphics)
2 comments

(author of Ristretto here) Yeah, I'm surprised not enough people here are talking about Ristretto. It was actually designed with knowledge of the existing Go caches, to deal with their limitations -- based on multiple papers and Caffeine [1], popular in Java world. In particular, achieving higher hit ratios while avoiding contention caused by heavy concurrent access.

This is worth a read: https://blog.dgraph.io/post/introducing-ristretto-high-perf-...

[1]: https://github.com/ben-manes/caffeine

Alas, Ristretto implements an eventual consistency.
Feel free to file an issue if that's a concern -- if enough people feel the same way we could provide an option to "synchronous consistency". It wasn't one in the use cases we looked at.
It would be a significant performance tradeoff, if I understand correctly. So there's no point, there are enough ACID in-memory databases in the world)
Most likely not a performance tradeoff. For every Get and Set, we do lookups anyway. Caffeine, for comparison, always sets the key-value, and then if the key doesn't get admitted due to policy, deletes it later.