10 ms·
Clang uses vectors for both. https://gcc.godbolt.org/z/G997Ge9KT https://gcc.godbolt.org/z/G997Ge9KT
by vyodaiken 5y ago
Clang uses vectors for both.
https://gcc.godbolt.org/z/G997Ge9KT https://gcc.godbolt.org/z/G997Ge9KT
- tom_mellior 5y agoYes, with lots of extra ceremony around it. (More than is needed, since it doesn't seem to realize that it will always process exactly 16 loop iterations.) Since you've posted a lot along the lines of "these optimizations don't even make a difference", you might want to see if Clang's safer-looking version is as fast as GCC's.
- vyodaiken 5y agoIt's not an interesting optimization. Micro-benchmarks are of limited utility. The extra complication is to protect the code from flying off and writing on random memory. Well worth it.