msokolov commented on a change in pull request #18: URL: https://github.com/apache/lucene/pull/18#discussion_r594820508
########## File path: lucene/core/src/java/org/apache/lucene/util/VectorUtil.java ########## @@ -17,16 +17,123 @@ package org.apache.lucene.util; +import java.lang.invoke.MethodHandle; +import java.lang.invoke.MethodHandles; +import java.lang.invoke.MethodType; +import java.util.Base64; + /** Utilities for computations with numeric arrays */ public final class VectorUtil { private VectorUtil() {} + // org.apache.lucene.util.VectorUtilSIMD#dotProduct(float[], float[]) + private static final String SIMD_BASE64 = + "yv66vgAAADwAbQoAAgADBwAEDAAFAAYBABBqYXZhL2xhbmcvT2JqZWN0AQAGPGluaXQ+AQADKClW\n" Review comment: So I ran my usual HNSW benchmark using KnnGraphTester, which is 1M 256-dim vectors. This was run on my 2-core i7 laptop . Indexing performance improved from 412 sec to 292 sec, and search times improved somewhat less (latency column in table below). These benchmarks are kind of noisy, but they are predictive of what performance we'd expect in an application. Probably we aren't able to pump vectors through the L2 cache fast enough to keep up with the CPU at this point. We might be able to restructure the search code to try to do some pipelining? ## JDK16 --add-modules jdk.incubator.vector recall latency nDoc fanout maxConn beamWidth visited index ms 0.881 0.49 1000000 10 20 50 1154 291684 0.897 0.60 1000000 25 20 50 1262 0 0.913 0.63 1000000 50 20 50 1444 0 0.934 0.92 1000000 100 20 50 1791 0 ## JDK-11 0.884 0.63 1000000 10 20 50 1143 412111 0.888 0.66 1000000 25 20 50 1248 0 0.913 0.78 1000000 50 20 50 1434 0 0.929 1.00 1000000 100 20 50 1783 0 ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org For additional commands, e-mail: issues-h...@lucene.apache.org