Vector API performance

Bruno Rafael Sant Ana bruno.santana.ti at gmail.com
Fri May 26 03:24:04 UTC 2023


Hi everyone,

This is the first time I'm using a Java mailing list, so hopefully I'm
doing it correctly.

I've heard that the Vector API should increase the performance when the
computer has a SIMD architecture.

I wrote this code to test the Vector API and surprisingly it seems to be
slower than the traditional way:

https://github.com/brunosantanati/java-new-features/blob/main/src/main/java/me/bruno/santana/incubator/VectorApiDemo.java

I got 5969 ns (traditional way) VS 48475736 ns (Vector API code). Why is
that? Maybe my laptop has no SIMD capabilities?

In addition to that, I have one more question. When I'm using the
IntVector.fromArray method passing an array with length less than 16 I get
an IndexOutOfBoundsException. Why is that?

Thank you!

-- 

*"Any fool can write code that a computer can understand. Good programmers
write code that humans can understand." Martin Fowler*
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/panama-dev/attachments/20230526/a4afe060/attachment.htm>


More information about the panama-dev mailing list