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

Maurizio Cimadamore mcimadamore at openjdk.org
Fri Jan 6 11:44:16 UTC 2023


On Wed, 4 Jan 2023 08:00:15 GMT, Per Minborg <pminborg at openjdk.org> wrote:

>> This PR proposes the addition of some benchmarks, for example using a LonBuffer and a VarHandle.
>
> Per Minborg has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Change to big endian for some variants

I have added the byte buffer bulk benchmarks to my slightly modified benchmark that uses native order everywhere (to avoid spurious costs associated with byte swapping):

https://github.com/mcimadamore/panama-foreign/blob/bits-bench/test/micro/org/openjdk/bench/java/lang/foreign/MemorySegmentVsBits.java

I can confirm that byte buffer with bulk put is as fast as memory segments, once byte swapping is removed from the equation:


Benchmark                           (size)  Mode  Cnt   Score   Error  Units
MemorySegmentVsBits.byteBufferBulk     256  avgt   30  23.998 ? 5.858  ns/op

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

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


More information about the panama-dev mailing list