⠋ Sewer56 ⣠ @sewer56.dev · Dec 22

Two functions. One implemented in high level Rust (left), one in Assembly (right). They both generate the same assembly, but the Rust one is 4x faster when benchmarking; why?🧵

0 likes 1 replies

?

Replies

⠋ Sewer56 ⣠ · Dec 22

Very simple!! 💀 Absolute bamboozlery!! ⚡⚡ Compiling the `bench` target gives you a nice, unrolled joy of SSE2/AVX2. Compiling the `lib` target, doesn't get you that. That's where the performance difference comes from!! Same compiler settings, but different output on different target.