unum-cloud / usearch

Fast Open-Source Search & Clustering engine × for Vectors & 🔜 Strings × in C++, C, Python, JavaScript, Rust, Java, Objective-C, Swift, C#, GoLang, and Wolfram 🔍
https://unum-cloud.github.io/usearch/
Apache License 2.0
2.28k stars 143 forks source link

Add -march=native in clang compile flags to enable auto-vectorization #406

Open Ngalstyan4 opened 6 months ago

Ngalstyan4 commented 6 months ago

Tested on Macbook Pro with 2.4 GHz Intel Core i9, Clang 15

grep output of objdump on bench_cpp when these flags are present:

postgres@4832feb5168c:/lantern_shared/third_party/usearch/build_release$
objdump -d ./bench_cpp | grep vzero | head
       1cad3:       c5 f8 77                vzeroupper
       1cb1e:       c5 f8 77                vzeroupper
       ...

grep output is empty when the flags are not present