-
Notifications
You must be signed in to change notification settings - Fork 56
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Performance much worse than hnswlib #67
Comments
Do you have the code somewhere ? It's definitely slower but not 100 times for sure |
I have attached the code as zip file. I am testing against the glove-100-angular dataset that can be downloaded from ann-benchmarks.com. It has 1M vectors. d = 100. and 10k test vectors. The Java code (this library) takes 2 mins to build the index (i.e., adding 1M vectors to the index) and 4.6s to query the index (10k test vectors). The C++ code (original hnswlib) takes 35.94 seconds to build the index and 0.048 seconds to query the index (i.e., 100x faster). Both tests run on same Linux machine with 14 threads (1 thread per vCPU). the multi-threading only applies when building the index. Querying is single-threaded in both cases. |
one question (unrelated to the topic in this thread btw) is that w.r.t. this:
Can't you just use
like you do on line 268 Another question I have is that I tried the code with SIMD optimizations on a AVX512 CPU but the perf is basically the same. Do you know why? I was expecting 16x improvement in perf (16*32=512) as one instruction would process 16 floats. |
re: this: Another question I have is that I tried the code with SIMD optimizations on a AVX512 CPU but the perf is basically the same. Do you know why? I was expecting 16x improvement in perf (16*32=512) as one instruction would process 16 floats. could it be that Java compiler is auto-vectorizing the code without explicit SIMD optimizations? e.g., see this:
do you know if is there any way to verify? |
Hello All, Thanks, Jianshu |
Hello,
Thanks for this library. I did some benchmarking and the search is 100x slower than the C++ hnswlib. do you know why?
The text was updated successfully, but these errors were encountered: