3 ms·
Dumb question, what is "2-random"?
by mapgrep 9y ago
Dumb question, what is "2-random"?
- sethammons 9y agoFrom 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.]
- mapgrep 9y agoThanks! Sorry, I missed that.
- AnimalMuppet 9y agoOn 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 ">".
- mnarayan01 9y agoPick two entries at random, and then choose the least recently used one.
- plandis 9y agohttp://www.eecs.harvard.edu/~michaelm/postscripts/handbook2001.pdf 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.