Re:Mispredicted branches can multiply your running times
by SloopJon on Wednesday October 16, 2019 @10:28AM
(#21270693)
It strikes me that the example is a bit contrived: why is howmany decremented unconditionally? The first loop populates out with howmany numbers. The second loop may set none (other than the ignored value that you point out). I suppose you can use the same trick:
howmany -= (val bitand 1);
But that might complicate the benchmark.
Coincidentally, this was the subject of the first Stack Overflow question Bjarne addressed in an interview the other day:
Coincidentally, this was the subject of the first Stack Overflow question Bjarne addressed in an interview the other day:
https://stackoverflow.com/questions/11227809/why-is-processi...