3 ms·
FYI. https://quick-bench.com/q/sK9t9GoFDRkx9XxloUUbB8Q3ht4 https://quick-bench.com/q/sK9t9GoFDRkx9XxloUUbB8Q3ht4' Using this microbenchmark on an Intel Sapphir
by jeffbee 3y ago
FYI. https://quick-bench.com/q/sK9t9GoFDRkx9XxloUUbB8Q3ht4 https://quick-bench.com/q/sK9t9GoFDRkx9XxloUUbB8Q3ht4'
Using this microbenchmark on an Intel Sapphire Rapids CPU, compiled with march=k8 to get the older form, takes ~980ns, while compiling with march=native gives ~570ns. It's not at all clear that the imperfection the article describes is really relevant in context, because the compiler transforms this function into something quite different.
- fooker 3y agoWith random test cases, branch prediction can't help.