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.
Hash tables with O(1) worst-case lookup and space efficiency [pdf]
31–40 of 45 posts
Re: Hash tables with O(1) worst-case lookup and space efficiency [pdf]
#32I'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.
Re: Hash tables with O(1) worst-case lookup and space efficiency [pdf]
#33Counter-intuitively, I've also noticed in many cases that using binary search over sorted elements in contiguous memory is actually faster than using a hash table at all.
Has anyone else found this?
Re: Hash tables with O(1) worst-case lookup and space efficiency [pdf]
#34Re: Hash tables with O(1) worst-case lookup and space efficiency [pdf]
#35Re: Hash tables with O(1) worst-case lookup and space efficiency [pdf]
#36Re: Hash tables with O(1) worst-case lookup and space efficiency [pdf]
#37Every time I've tried comparing cuckoo hashing vs traditional hash algorithms in practice, the time taken to compute the additional hash functions outweighs any gains in performance. Counter-intuitively, I've also noticed in many cases that using binary search over sorted elements in contiguous memory is actually faster than using a hash table at all. Has anyone else found this?
Re: Hash tables with O(1) worst-case lookup and space efficiency [pdf]
#38I'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.
I'd been wondering how best to make an LRU cache, and now you come along and give a really good solution. Nice!
Re: Hash tables with O(1) worst-case lookup and space efficiency [pdf]
#39Is open-source implementation of this data structure available somewhere?