In java 8 java.util.Hashmap I noticed a change from:
static int hash(int h) {
h ^= (h >>> 20) ^ (h >>> 12);
return h ^ (h >>>
When I ran hash implementation diffences I see time difference in nano seconds as below (not great but can have some effect when the size is huge ~1million+)-
7473 ns – java 7
3981 ns– java 8
If we are talking about well formed keys and hashmap of big size (~million), this might have some impact and this is because of simplified logic.