On Wed, 8 Jul 2026 15:30:43 GMT, Chen Liang <[email protected]> wrote:

>> It would, to me, make most sense to align with Long.hashCode, unless there's 
>> a valid reason not to.
>
> I think reusing 4-byte-wise accumulation might be easier for compilers to 
> reuse hardware instructions?

I had a look at the history of this current implementation and it appears to 
have been introduced through https://github.com/openjdk/valhalla/pull/1773. 
It's not clear that the current implementation was intentionally chosen in 
favour of how it's done in Long.hashCode(). I've filed 
https://bugs.openjdk.org/browse/JDK-8388062 to track this discussion and decide 
whether any change is warranted.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/31123#discussion_r3557191076

Reply via email to