The common pattern in use was similar to
which works by creating a Object array of size n, copying the object references into it and then calling the varargs hash() method. In some cases, an intermediate computation was also being autoboxed, using still more memory.
This code can be replaced with calls like
which is several times faster and does not generate any garbage objects.
The impact is large when a containing map is resized for larger component hierarchies, resulting in repeated hashcode re-computations.
A pull request was submitted with proposed changes to the code for this issue: link #513