Hacker News new | ask | show | jobs
by sandGorgon 1123 days ago
Can someone answer this - today elasticsearch/lucene does vector search using HNSWLib.

Will this allow lucene to drop hnswlib and get similar performance using native java ?

1 comments

Elasticsearch/Lucene do not use HNSWLib, they use their own Java implementation of the HNSW algorithm. But Java, being a virtual machine, doesn't have access to some lower level CPU instructions known to make certain calculations of vector similarity fast (aka SIMD).

Java has taken its sweet time exposing these optimizations in a consistent way. They're available by turning on a flag. But the API for using these optimizations is fairly brittle and could change in the next Java version.

But long story short, they implemented something to turn on the flag, and improve their own HNSW performance. Fingers crossed Java gets its act together.