userver
userver copied to clipboard
Explore using TinyLFU instead of the LRU algorithm
From time to time, we raise the question of LRU efficiency in the internal discussions.
We could try improving the basic implementation of LRU caches by replacing LRU with TinyLFU or any other top-notch algorithm.
Motivation points:
- In the last 5-10 years, many papers have been published with detailed descriptions of more efficient algorithms
- Advanced algorithms are implemented in the neighboring languages:
- TinyLFU in Go: https://dgraph.io/blog/post/introducing-ristretto-high-perf-go-cache
- TinyLFU in Java: https://github.com/ben-manes/caffeine
- It is possible to improve the performance of many services (use memory more efficiently)
- One can write an article and speak at a conference (ZeroConf C++ needs some technical reports!)