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
1.92k stars 109 forks source link

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

Open Ngalstyan4 opened 1 month ago

Ngalstyan4 commented 1 month 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