Hacker News new | past | comments | ask | show | jobs | submit login

Dumb question, what is "2-random"?



From the article:

...on real workloads, random tends to do worse than other algorithms. But what if we take two random choices and just use LRU between those two choices?

"2-random" is his short hand for the above scenario.

[edit: formatting, I have no idea how to signify a quote; I don't want preformatted because it makes a scroll box.]


On HN, typically a quote is done like this:

> This is a quote. It won't become a scroll box, no matter how long it gets. It will just wrap to the next line. True, the next line won't begin with a ">" character, but the convention is that the whole paragraph is a quote if the first line begins with a ">".


Thanks! Sorry, I missed that.


Pick two entries at random, and then choose the least recently used one.


http://www.eecs.harvard.edu/~michaelm/postscripts/handbook20...

Basically pick-2 allows you to make a mixture of a totally random and optimal choice in cases where you have imperfect information that is much more resilient to the staleness of data than either a random choice or the globally optimum choice.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: