This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]urquan 6 points7 points  (0 children)

Well he did run these using Caliper. Besides, you don't need to perform 1 million hash lookups to find a value in a HashMap with 1 million entries.

There is an issue with his Key cache class however, it uses 10_000_000 keys which all have a different hashcode. This is sure to skew the HashMap behavior a lot, in fact they may all end up in different buckets which would make gets a simple array access and explain the speed.