Single Instruction Multiple Data (SIMD) instructions have been available in Intel and other processor instruction sets for over 25 years. The current implementation is Advanced Vector eXtensions (AVX), first introduced in the Sandy Bridge microarchitecture.
Using Vector processing through AVX can profoundly improve the performance level of an application that includes numerically intensive operations. The difficulty is that, although the compiler should be responsible for determining their use, code is often too complex to do so effectively.
In JDK 16, an incubator module for the Vector API (not to be confused with the Vector collections class) was introduced. This allows a developer to express vector computations that reliably compile at runtime to optimal vector instructions. The API has undergone several revisions resulting in the sixth incubator in JDK 21.
In this session, we'll explore how to use the Vector API in different use cases, comparing the code generated by the JIT compiler without the API and with it. We'll also look at what difference this makes to the performance delivered.