[foreign-memaccess+abi] RFR: Add benchmarks to MemorySegmentVsBits [v2]

Uwe Schindler uschindler at openjdk.org
Thu Jan 5 16:39:16 UTC 2023


On Thu, 5 Jan 2023 16:19:35 GMT, Maurizio Cimadamore <mcimadamore at openjdk.org> wrote:

>> Per Minborg has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Change to big endian for some variants
>
> For the records - the extra benchmarks are here:
> 
> 
> @Benchmark
>     public void panamaHeapBulk() {
>         MemorySegment.copy(longs, 0, segment, JAVA_LONG_UNALIGNED, 0, size);
>     }
> 
>     @Benchmark
>     public void panamaNativeBulk() {
>         MemorySegment.copy(longs, 0, nativeSegment, JAVA_LONG, 0, size);
>     }
> 
>     @Benchmark
>     public void panamaNativeUnalignedBulk() {
>         MemorySegment.copy(longs, 0, nativeSegment, JAVA_LONG_UNALIGNED, 0, size);
>     }

Thanks @mcimadamore this confirms what we have seen in Lucene regarding the array copies. I did not implement a manual one-by-one copy for small arrays like ByteBuffer as for longs or floats the boundary would be around 2 or 3 array items. This benchmark explains what you already said.

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

PR: https://git.openjdk.org/panama-foreign/pull/762


More information about the panama-dev mailing list