Java Must Be Faster: Time for the Vector API
summary
Java code uses Project Panama's Vector API to hand-roll SIMD dot products for Lucene and Elasticsearch, replacing iterative float loops with lane-wise accumulation, explicit tail handling and Vector species to adapt to 128/256/512-bit vectors. Benchmarks show roughly 8x throughput on wide vectors in microbenchmarks, meaningful nightly gains in Lucene/Elasticsearch, and cases that beat native C++ implementations; HotSpot avoids floating-point auto-vectorization because of non‑associativity, so explicit SIMD is necessary.
AI-written summary · about
chapters (9)
- 0:00Introduction and speaker intro
- 0:46What is SIMD and vector units
- 2:33HotSpot and auto-vectorization limits
- 3:39Floating point and JVM constraints
- 5:03Apache Lucene overview
- 6:08Vector search basics
- 7:55Vector API benefits and simplicity
- 8:38Benchmark results and performance gains
- 9:42Java beating native implementations
