[vectorIntrinsics] RFR: Remove `byte[]` and `ByteBuffer` access methods.

Paul Sandoz psandoz at openjdk.java.net
Fri Apr 8 15:12:02 UTC 2022


On Fri, 8 Apr 2022 04:17:34 GMT, Jie Fu <jiefu at openjdk.org> wrote:

>> Removes `byte[]` and `ByteBuffer` vector access methods.
>> 
>> Fixes performance issue with the fallback implementation of `MemorySegment` accessors (the `ValueLayout` passed to the scalar accessors needs to be constant).
>
> Hi @PaulSandoz ,
> 
> Is there any perf number before and after this patch?
> Also why there is no JBS for this PR?

Hi @DamonFool, issues are optional for integration into the `panama-vector` repo.

Performance-wise `MemorySegment` is similar to `byte[]` and `ByteBuffer` (heap and direct), which is not too surprising since the `base`/`offset` are extracted from a segment and passed to the `load`/`store` vector intrinsic.

There is one performance anomaly I have observed related to using an `int`-based loop and `int` offset. This results in a widening conversion to `long` when passing the `int` value as the `offset` argument to the access method. The memory addressing logic is not efficient, which exacerbates with unrolling. This may be more generally C2 related, but it requires further investigation.

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

PR: https://git.openjdk.java.net/panama-vector/pull/190


More information about the panama-dev mailing list