Why is Rust not able to optimize this?
Surprisingly, when I compile and inspect the assembly generated by these two functions, the C++ version seems to be more optimized than the Rust version. I would have expected Rust to perform similarly.
I'm curious about the reasons behind this difference. Is there something inherent in Rust's design or compilation process that makes it less effective in optimizing such straightforward arithmetic operations?