3 ms·
Java still uses a linked list chaining until a threshold is met (8 currently) which it then switches the bucket to a tree. I wish java could switch to open addr
by jay-anderson 10y ago
Java still uses a linked list chaining until a threshold is met (8 currently) which it then switches the bucket to a tree. I wish java could switch to open address hashing, but without value types it wouldn't help much (there's work on adding them: http://cr.openjdk.java.net/~jrose/values/values-0.html http://cr.openjdk.java.net/~jrose/values/values-0.html).
Linear probing would likely be better than cuckoo hashing from a cpu cache perspective (all locations closer in memory). There are probing schemes which result in low number of checks and allow for higher loading factors similar to cuckoo hashing (e.g. robin hood hashing. See http://codecapsule.com/2013/11/17/robin-hood-hashing-backward-shift-deletion/ http://codecapsule.com/2013/11/17/robin-hood-hashing-backwar...)
- dom0 10y agoStrategy performance seems to be a rather mixed bag. In some testing we've done RH (completely implemented) performed somewhat worse across the board, but allowed higher load factors, compared to simple linear-probing. However, it would seem that RH doesn't (directly) suffer from tombstoning, which is rather problematic with LP for long-lived tables.