3 ms·
Not Rust, though it is something that LLVM does will do to Rust code, quite often.
by kibwen 9y ago
Not Rust, though it is something that LLVM does will do to Rust code, quite often.
- andrewflnr 9y agoSure, but that's not something you can rely on, is it?
- kibwen 9y agoIt's just an optimization, so obviously it's not guaranteed, but that doesn't mean it's random. And if it's in your hot loop and not being optimized away, benchmarking will find it easily. At the same time, array indexing in Rust is vanishingly rare IME... turns out I only ever used it for `for` loops, which are better served by iterators. :P