[GR-50774] ByteArrayAccessCloneBenchmark#unsafeCopyMemory
does not use ARRAY_BYTE_BASE_OFFSET
#8763
Labels
ByteArrayAccessCloneBenchmark#unsafeCopyMemory
does not use ARRAY_BYTE_BASE_OFFSET
#8763
Describe the issue
The class
ByteArrayAccessCloneBenchmark#unsafeCopyMemory
uses 0 as offset values for theUnsafe#copyMemory
call:graal/truffle/src/com.oracle.truffle.api.benchmark/src/com/oracle/truffle/api/benchmark/ByteArrayAccessCloneBenchmark.java
Line 90 in 0808c62
I think this is incorrect; it should instead use
Unsafe#ARRAY_BYTE_BASE_OFFSET
1. Otherwise the current code actually also copies the array header and misses the last elements. This is not only incorrect behavior, but it might also distort the benchmark since it is accessing a slightly different memory section than all other methods (?).Footnotes
And technically it should maybe also multiply
array.length
byARRAY_BYTE_INDEX_SCALE
? But since that value is 1 it might not matter much. ↩The text was updated successfully, but these errors were encountered: