TLDR Web Dev · ARTICLES & TUTORIALS

CACHES: LRU VS RANDOM

danluu.com5 min read

Summary from the TLDR Web Dev newsletter

A random eviction policy performs surprisingly well for large caches. It often outperforms LRU in terms of miss rate, especially when cache size increases. This may mean that different approaches may suit different cache levels. Combining LRU for smaller caches and 2-random for larger ones might be promising. The “random” principle applies to various scenarios beyond cache eviction, like load balancing and data distribution.