Foreign + Vectors - benchmarks for copying and swapping

Paul Sandoz paul.sandoz at oracle.com
Fri Jun 18 19:55:11 UTC 2021


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).

—

There is something odd going on when tiered compilation is switched off, the result for copyWithVector is much worse for smaller sizes.

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. 

This needs a more focused investigation comparing vector array access with buffer access. 

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