HN Hall of Fame Weekly email

Cache Eviction: When Are Randomized Algorithms Better Than LRU? (2014)

danluu.com Essays & writing Essays & articles Computer science Candidate
Screenshot of danluu.com captured 2026-07-20
Page preview · captured 2026-07-20

Resurfaced independently across 4 calendar years, with breakout response in 3 of them.

submissions
4
submitters
4
observed span
2017–2025
peak thread · 67 comments
235 pts
latest 20+ return · 2025-07-31
112 pts

Submission timeline

2007–2026

One slot for every year since HN launched. Height is that year's peak points; orange marks a 100+ point or 50+ comment breakout. Select a bar to open its strongest thread.

First comments on top threads

HN comment order

> When Are Randomized Algorithms Better Than LRU? When the access pattern is random: recently used items are not more likely to be accessed than other items. Or worse: the access pattern is "anti-recent": items recently accessed are less likely to be accessed again than other items. This is undergraduate stuff I once had to know for exams in machine architectures and operating systems. The choice of LRU replacement is favorable when there exists "locality of reference"; that's what it's…

Related: the author, Dan Luu has, IMHO, one of the best IT-related Twitter feeds out there: https://twitter.com/danluu Highly recommended.

> But what if we take two random choices (2-random) and just use LRU between those two choices? > Also, we can see that pseudo 3-random is substantially better than pseudo 2-random, which indicates that k-random is probably an improvement over 2-random for the k. Some k-random policy might be an improvement over DIP. This sounds very similar to tournament selection schemes in evolutionary algorithms. You can control the amount of selective pressure by adjusting the tournament size. I think…

bob1029·112-point thread·

I've been playing a lot of Baldur's Gate 3 lately and this kind of reminds me of when you have to roll a d20 in a skill check. Early in the game there are skill checks with a difficultly class of 2 (need to roll a 2 or higher to succeed) but you might have proficiency in that skill so you get a +3 modifier to your roll. But if your base d20 roll result is a 1 then this…

jlhawn·92-point thread·

The first top-level comment from each of the four biggest threads, in HN’s own order. Excerpts are shortened; open a comment for full context.

Breakout years
3

100+ points or 50+ comments

Total points
631

reference only — not used in Hall rules or ranking

Total comments
157

reference only — not used in Hall rules or ranking

Every submission

DateTitle as submittedByPointsComments
2017-04-19Cache eviction: when are randomized algorithms better than LRU? (2014)First breakoutsigna1119267
2019-02-18Cache Eviction: When Are Randomized Algorithms Better Than LRU? (2014)Best threadzwliew23542
2024-01-22Caches: LRU vs. Random (2014)eatonphil9226
2025-07-31Caches: LRU vs. RandomLatest 20+ point returngslin11222