Try switching to -O3, see if it speeds things up
itamarst opened this issue · comments
-O3 enables auto-vectorization, among other compiler optimizations, so might make things run faster. Blocked on #81
Some numbers from experiments:
Compiler | Options | Speed (MB/sec) |
---|---|---|
gcc 11 | Default | 360 |
gcc 11 | -O3 | 230 |
clang 14 | Default | 375 |
clang 14 | -O3 | 377 |
gcc 11 | -march=x86-64-v2 | 478 |
gcc 11 | -O3 -march=x86-64-v2 | 446 |
gcc 11 | -O3 -march=x86-64-v3 | 446 |
-O3 was not helpful!
Main speed up for compiler options, as seen above, is telling the compiler you're not on an ancient CPU. Here was RHEL 9's explanation of why they switched to this: https://developers.redhat.com/blog/2021/01/05/building-red-hat-enterprise-linux-9-for-the-x86-64-v2-microarchitecture-level
It's hard to get survey data, best I know of is Steam's. It suggests maybe... 0.6% of computers in their survey won't work with x86-64-v2 due to e.g. lack of SSE4.2. https://store.steampowered.com/hwsurvey/Steam-Hardware-Software-Survey-Welcome-to-Steam