userver icon indicating copy to clipboard operation
userver copied to clipboard

Explore using TinyLFU instead of the LRU algorithm

Open Anton3 opened this issue 2 years ago • 0 comments

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!)

Anton3 avatar Nov 26 '22 12:11 Anton3