JEP 489: Vector API (Ninth Incubator)
Last updated
Last updated
The Vector API enables you to express vector computations in Java that are compiled at runtime to SIMD instructions, giving much better performance for certain numeric workloads — without writing native code.
It's part of the
jdk.incubator.vector
module and works best on CPUs that support SIMD (like AVX).
"We first proposed the Vector API in , integrated into JDK 16 as an . We proposed further rounds of incubation in (integrated into JDK 17), (JDK 18), (JDK 19), (JDK 20), (JDK 21), (JDK 22), and (JDK 23)."
Vector API: Exposes hardware-friendly operations (add, multiply, etc.) on arrays of primitives (int
, float
, etc.).
VectorSpecies<T>: Describes the size and shape of a vector supported on the current hardware.
HotSpot JIT: Automatically compiles vector operations to SIMD instructions (e.g., AVX on x86, SVE on ARM).
Portable & Safe: Unlike hand-written native code, vector code stays within Java’s safety and portability model.
Incubator Module: Available via jdk.incubator.vector
, still evolving.
Performance Boost
Exploits SIMD hardware features automatically
Platform Adaptation
Adapts to CPU capabilities at runtime
Clean Java API
No JNI, no unsafe — all pure Java
Vectorized Loops
Ideal for math-heavy tasks (e.g., image, ML)