Can you post a junit test or code that you used to measure this? Doesnt look like a bug but i will look into it.
The actual number of collisions can differ, especially if you use
strings and ints as keys because they use different hashes. To
actually calculate the number of collisions you'd need to alter or
track the internals of the implementation though (loops looking for an
empty or occupied slot).
Dawid
The number of actual slot collisions in HPPC can be measured as well,
but you'd need to peek inside the implementation and alter slot lookup
functions.
Dawid
Glad it's useful for someone!
> We thought the same way, so we first write all hashcodes of
> Arrays.hashCode() to a file, sort uniq -d them to identifiy
> the strings where the hashCode is the same, but they where uniq for
> all ints, no doublings occur to this point.
But they were hashcodes of the strings and when you create an Int*Map
then the input keys (ints) are re-hashed again and this may cause new
collisions. This additional rehashing is useful to randomize bad input
keys distributions and provides gains in practical applications
(experience speaking here, no proofs).
Dawid