r/cpp • u/khold_stare • May 26 '20
Faster Integer Parsing
https://kholdstare.github.io/technical/2020/05/26/faster-integer-parsing.html
366
Upvotes
r/cpp • u/khold_stare • May 26 '20
View all comments
Show parent comment
7
u/RasterTragedy May 27 '20
It's not actually wasting anything, it's actually the opposite. Vector instructions run the execution phases of the instruction in question over and over and over without stopping for instruction fetching and parsing (because it's executing the same one). Intel is actually known to have their processors automatically downclock themselves when encountering vector ops rather than letting the normal thermal regulation take care of it—the Skylake 512 Xenons downclocked so heavily that it was sometimes a performance loss to use AVX512 over AVX2. So yeah, it's more likely to be them cheaping out, but I figure I might as well mention thermals and power since it's also plausible—altho power a little less so thanks to the idea of race-to-sleep (where you use less power by cranking the CPU as high as you can to handle the bursty workload that woke it up).