Hotspot JVM Auto Vectorization and Vector API
summary
C2’s SuperWord auto‑vectorizer packs unrolled loops into SIMD and on the normal‑map demo a loop goes from ~36 FPS to ~130 FPS; a Vector API N‑body demo reaches ~170–180 FPS after tuning. JDK26 adds a runtime overlap check for MemorySegments (Panama) to safely vectorize copies; reductions and aliasing work improve throughput. Benchmarks show Netflix gets ~7–12% from vectorized dot products; beware AVX alignment pitfalls and that Vector API compress/filter examples can outperform scalar but fall back slowly on unsupported hardware.
AI-written summary · about
chapters (15)
- 0:00HotSpot JVM vectorization intro
- 1:00Vectorization and CPU performance
- 3:00Java vectorization models
- 5:56How HotSpot auto vectorizer works
- 8:03Demo: auto vectorization mapping
- 9:06Vector API for explicit vectorization
- 13:46Vectorized array algorithms
- 15:31Mapping and reduction with vectors
- 20:07Floating-point reductions handling
- 22:15Vectorized array copy checks
- 26:06Vectorizing loops with control flow
- 30:58Data filtering with vectors
- 34:10Demo: Vector API in particle sim
- 37:19Summary and future of Java vectorization
- 40:23Q&A on vectorization








