News for hackers. Stuff that matters.
Re:Incrementing vectors by totalperspectiv on Monday August 26, 2019 @03:27PM (#20802879)
To answer both my own questions. Rust does not seem to have this same problem: https://godbolt.org/z/JpwcRN

But iterating over the loop with .iter_mut is different than iterating over 0..v.len(), which is interesting.

Re:Incrementing vectors by masklinn on Tuesday August 27, 2019 @06:51AM (#20808153)
I'm guessing its bounds-checking, though replacing v[i] += 1 by `*v.get_unchecked_mut(i) += 1` generates yet another bit of code (it seems to somewhat unroll the loop but stops there).

Also you can use `-C target_cpu=native` and get AVX512 instructions on godbolt's.