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

Maurizio Cimadamore mcimadamore at openjdk.org
Tue Jan 3 10:33:07 UTC 2023


On Tue, 3 Jan 2023 10:23:16 GMT, Maurizio Cimadamore <mcimadamore at openjdk.org> wrote:

>> This PR proposes the addition of some benchmarks, for example using a LonBuffer and a VarHandle.
>
> test/micro/org/openjdk/bench/java/lang/foreign/MemorySegmentVsBits.java line 109:
> 
>> 107:     public void byteVarHandle() {
>> 108:         for (int i = 0; i < size; i++) {
>> 109:             LONG_ARRAY_VH.set(bytes, i * Long.BYTES, longs[i]);
> 
> Is this offset multiplication correct? e.g. I would assume that var handles created with `byteArrayView` would take a logical index?

Nevermind - that seems to be correct - it's equivalent to `ByteBuffer.getLong`

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

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


More information about the panama-dev mailing list