Re:Rust is now overall faster than C in benchmarks
by shepmaster on Sunday January 03, 2021 @02:41PM
(#25624479)
Why does the Rust compiler not optimize code assuming that two mutable references cannot alias? —https://stackoverflow.com/q/57259126/155423
[ Parent
| on HN ]
Re:Rust is now overall faster than C in benchmarks
by arcticbull on Sunday January 03, 2021 @02:42PM
(#25624496)
Follow along here for re-enabling: https://github.com/rust-lang/rust/issues/54878
For what it's worth I did say "can be" not "is" because I wasn't sure of the current state of this feature. I was just passing on the theory.
There are certainly other potential reasons, for instance constant expressions and generics. And, of course, the prohibited undefined behavior makes other optimizations possible, and potentially better.