LRU Cache

If you have a tight loop, LRU is going to be perfect as long as the loop fits in cache, but it’s going to cause a miss every time if the loop doesn’t fit. A random eviction policy degrades gracefully as the loop gets too big. - Caches: LRU v. random / HN

see also

Written on April 27, 2021, Last update on January 23, 2024
algorithm cache leetcode random