RFR: 8321279: Implement hashCode() in Heap-X-Buffer.java.template [v3]

Alan Bateman alanb at openjdk.org
Fri Dec 8 06:29:17 UTC 2023


On Wed, 6 Dec 2023 19:55:01 GMT, Sergey Tsypanov <stsypanov at openjdk.org> wrote:

>> Currently `Heap*Buffer.hashCode()` is inherited from `*Buffer` and implemented as 
>> 
>> public int hashCode() {
>>     int h = 1;
>>     int p = position();
>>     for (int i = limit() - 1; i >= p; i--)
>>         h = 31 * h + (int)get(i);
>>     return h;
>> }
>> 
>> This can be improved using `ArraysSupport.vectorizedHashCode()`
>
> Sergey Tsypanov has updated the pull request incrementally with one additional commit since the last revision:
> 
>   8321279: Fix hashCode()

Are you planning to add a microbenchmark?

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

PR Comment: https://git.openjdk.org/jdk/pull/16992#issuecomment-1846612566


More information about the nio-dev mailing list