r/java • • Jul 20 '26

Comprehensive JVM Primitive Hashtable Benchmarks

https://sooniln.github.io/posts/hashmap-benchmarks-2026/
23 Upvotes

4 comments sorted by

View all comments

Show parent comment

4

u/tooilln Jul 20 '26

You're right that number -> number is probably rarer than number -> reference, but most of these libraries offer number -> reference maps as well, and given that values are the least important bit of a map usually (in terms of performance), I would expect this benchmarking to largely hold true for the number -> reference maps as well.

Your larger point that reference -> reference maps dominate usage is of course completely correct.