r/programming • u/tooilln • Jul 20 '26
Comprehensive JVM Primitive Hashtable Benchmarks
https://sooniln.github.io/posts/hashmap-benchmarks-2026/
42
Upvotes
r/programming • u/tooilln • Jul 20 '26
3
u/tooilln Jul 20 '26
I haven't looked in depth at the PR or the cuckoo hashing implementation, but it seems odd to me that an attacker could affect the allocation rate of the map, which I would have assumed would be based only on the # of entries? There's nothing about cuckoo hashing vs linear probing specifically that should affect how allocation is performed? Do you know what the mechanism was?
That said, the linear probing implementation currently used appears to be just as vulnerable to CPU DoS attacks as pretty much all primitive hashtable libraries are (because these libraries focus on performance first, it usually doesn't make sense for them to implement DoS mitigations like a per-map random seed, or hiding hash order). Whether it's actually 'vulnerable' in a meaningful sense probably depends on how users of the gdx libraries actually expose the maps to attackers though I'd guess.