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.
Also you can use `-C target_cpu=native` and get AVX512 instructions on godbolt's.