nmslib / hnswlib

Header-only C++/python library for fast approximate nearest neighbors
https://github.com/nmslib/hnswlib
Apache License 2.0
4.27k stars 629 forks source link

BLAS & OMP vs. SSE/AVX #133

Open tanliboy opened 5 years ago

tanliboy commented 5 years ago

Have we considered optimize the distance calculation with BLAS & OpenMP vs. SSE/AVX?

The BLAS (e.g.MLK) operations are deeply optimized, and they might be able to outperform our current code with SSE/AVX given it includes ad hoc dimension check (divide-able by 4/16).

yurymalkov commented 5 years ago

Yes, this can be done, but I do not remember if I've tried it. This would add a big dependence, as a minus. If somebody could do it as an optional feature, that would be awesome!