Re: RFR: 8294432: Add provisions to calculate hash values from MemorySegments

2024-11-27 Thread Per Minborg
On Wed, 27 Nov 2024 11:21:32 GMT, Maurizio Cimadamore wrote: >> This PR proposes adding a _JDK-internal_ method for calculating hash codes >> for content in a `MemorySegment`. >> >> The internal method uses a polynomial 32-bit hash function equivalent to >> `Arrays::hashCode`. The new method

Re: RFR: 8294432: Add provisions to calculate hash values from MemorySegments

2024-11-27 Thread Maurizio Cimadamore
On Mon, 25 Nov 2024 15:27:13 GMT, Per Minborg wrote: > This PR proposes adding a _JDK-internal_ method for calculating hash codes > for content in a `MemorySegment`. > > The internal method uses a polynomial 32-bit hash function equivalent to > `Arrays::hashCode`. The new method is almost two

Re: RFR: 8294432: Add provisions to calculate hash values from MemorySegments

2024-11-27 Thread Maurizio Cimadamore
On Mon, 25 Nov 2024 15:27:13 GMT, Per Minborg wrote: > This PR proposes adding a _JDK-internal_ method for calculating hash codes > for content in a `MemorySegment`. > > The internal method uses a polynomial 32-bit hash function equivalent to > `Arrays::hashCode`. The new method is almost two

Re: RFR: 8294432: Add provisions to calculate hash values from MemorySegments

2024-11-26 Thread Per Minborg
On Tue, 26 Nov 2024 13:55:10 GMT, Viktor Klang wrote: >> This PR proposes adding a _JDK-internal_ method for calculating hash codes >> for content in a `MemorySegment`. >> >> The internal method uses a polynomial 32-bit hash function equivalent to >> `Arrays::hashCode`. The new method is almos

Re: RFR: 8294432: Add provisions to calculate hash values from MemorySegments

2024-11-26 Thread Viktor Klang
On Mon, 25 Nov 2024 15:27:13 GMT, Per Minborg wrote: > This PR proposes adding a _JDK-internal_ method for calculating hash codes > for content in a `MemorySegment`. > > The internal method uses a polynomial 32-bit hash function equivalent to > `Arrays::hashCode`. The new method is almost two

RFR: 8294432: Add provisions to calculate hash values from MemorySegments

2024-11-26 Thread Per Minborg
This PR proposes adding a _JDK-internal_ method for calculating hash codes for content in a `MemorySegment`. The internal method uses a polynomial 32-bit hash function equivalent to `Arrays::hashCode`. The new method is almost two times faster than naïvely iterating over individual bytes for la