3 ms·
I've had some luck turning a cuckoo hash into a sort of LRU cache. Whenever you do an insert, replace the older item. Iirc, everything else stayed the same. Usi
by sigstoat 16y ago
I've had some luck turning a cuckoo hash into a sort of LRU cache. Whenever you do an insert, replace the older item. Iirc, everything else stayed the same. Using more than 2 hashed really helped.
- pjscott 16y agoI'd been wondering how best to make an LRU cache, and now you come along and give a really good solution. Nice!
- jrockway 16y agoThat is not LRU, it's "replace with some other random thing some time, based on a hash function".
- gfodor 16y agoThis is really clever, thanks for the hack.
- Deestan 16y agoThat's not a hack. It's an algorithm.
- martinkallstrom 16y agoOoh so a hack is sort of an eigentransform of an algorithm in the sense that a hacked algorithm is still an algorithm.