Spent the day going down the rabbit hole of LRU and exploring different variants, each optimized for a certain class of workloads.
Here are 5 that I explored today. btw, there are 50 more to explore, but I am not going to do that as I found what I was looking for.
- LRU-K - tracks K recent reference times
- TLRU - adds TTL-based eviction to LRU
- EELRU - predictive eviction before the cache fills
- LRFU - combines recency with frequency weighting
- SLRU - separates protected and probationary segments
If you find this interesting, you can use your favorite LLM to dig deeper.
Btw, I never read without a purpose. I picked this topic because I wanted to see if I could spot a gap in existing implementations and identify something that could be exploited and improved for certain workloads.
Digging deeper into one topic makes you realize that everything is a rabbit hole, no exceptions.