2 ms·
Well I mostly agree when the first Google result answer the claim. I've clicked on most links from your Google query and was not able to find something that pr
by The_rationalist 7y ago
Well I mostly agree when the first Google result answer the claim.
I've clicked on most links from your Google query and was not able to find something that prove Anecdotally, rustc is also much better at generating SIMD-friendly code with iterators than idiomatic C/C++
Most of the links are about explicit SIMD, something that is off topic with the initial claim and something that c/c++ do far better (so many SIMD libs), and are also better at hybrid SIMD (SPMD, OpenMP 5,o penACC, etc).
"Anecdotally, rustc is also much better at generating SIMD-friendly code with iterators than idiomatic C/C++"
The author talk about auto vectorization.
Firstly c/c++ supports AVX512 while rust do not (in stable at least)
Secondly real world llvm/gcc dev are paid to improve c/c++ performance, rust performance improvements are only a side effect.
And iterators in c++ are idiomatic and I see no reason why rust iterators would auto vectorize better than c++ ones.
And c++ do not enforce bounds check (but allow it with at(), anyway bounds check are a totally useless concept because they slow down release performance and capture far less information for debugging than ASAN)
So the initial claim is non obvious and I see no answer on the Google query.
If nobody is able to prove it I will believe the claim is probably wrong.
- holy_city 7y agoSorry for the confusion. "Anecdotally" as in it's a personal anecdote, I've seen it in my own code.