Foreign + Vectors - benchmarks for copying and swapping
Maurizio Cimadamore
maurizio.cimadamore at oracle.com
Fri Jun 18 21:03:20 UTC 2021
On 18/06/2021 20:55, Paul Sandoz wrote:
> The order declared in the vector load/store overrides any order declared on the buffer (should make the specification clearer in that respect). (In this case in the source is bytes, so there is no swapping).
Doh - right!
>
> —
>
> There is something odd going on when tiered compilation is switched off, the result for copyWithVector is much worse for smaller sizes.
Is this what Uwe is seeing I wonder?
https://github.com/apache/lucene/pull/177#issuecomment-861265227
>
> With larger sizes with and without tiered, similar result are observed with similar generated code (of less quality than with tiered for smaller sizes, oddly enough).
>
> Whether tiered is enabled or not there is no loop unrolling.
>
> I think something may have regressed, although we have previously focused more on array access than buffer access.
Is the vector implementation performing a bulk copy into a byte array
IIRC? If so, maybe there's an issue with bulk copy - which would be the
same issue we're seeing on the memory access front?
>
> This needs a more focused investigation comparing vector array access with buffer access.
Maurizio
>
> Paul.
>
>> On Jun 18, 2021, at 1:09 AM, Maurizio Cimadamore <Maurizio.Cimadamore at Oracle.COM> wrote:
>>
>>
>>
>> On 17/06/2021 23:14, Radosław Smogura wrote:
>>> For endianess, I'm not sure how to check it, but it may not be a case, I try to use native order, and operate on bytes.
>> I guess what I mean is:
>>
>> https://github.com/rsmogura/panama-foreign/blob/foreign_and_vectors/test/micro/org/openjdk/bench/jdk/incubator/foreign/VectorCopySegments.java#L91
>>
>> Should this be:
>>
>> ```
>> final var src = srcAddress.asSegment(size, scope).asByteBuffer().order(ByteOrder.nativeOrder());
>>
>> ```
>>
>> And same for other derived buffers? You then use it as this:
>>
>> ```
>> final var srcVector = ByteVector.fromByteBuffer(BYTE_VECTOR_SPECIES, src, i, ByteOrder.nativeOrder());
>>
>> ```
>>
>> Which does smell like mismatched access?
>>
>> Cheers
>> Maurizio
>>
>>
>>
>>
>>
More information about the panama-dev
mailing list