3 ms·
> Combined over a billion iterations: 158,000x total slowdown I don't think that's a valid explanation. If something takes 8x as long then if you do it a billi
by fc417fc802 9mo ago
> Combined over a billion iterations: 158,000x total slowdown
I don't think that's a valid explanation. If something takes 8x as long then if you do it a billion times it still takes 8x as long. Just now instead of 1 vs 8 it's 1 billion vs 8 billion.
I'd be curious to know what's actually going on here to cause a multiple order of magnitude degradation compared to the simpler test cases (ie ~10x becomes ~150,000x). Rather than I-cache misses I wonder if register spilling in the nested loop managed to completely overwhelm L3 causing it to stall on every iteration waiting for RAM. But even that theory seems like it could only account for approximately 1 order of magnitude, leaving an additional 3 (!!!) orders of magnitude unaccounted for.
I think there's a lot more to the story here.
- piinbinary 9mo agoThat stuck out to me as well. I wonder if there could be a bug where extra code runs but the result is discarded (and the code that runs happens to have no side effects). The post also says > That is roughly 1 billion iterations but that doesn't sound right because GCC's version runs in only 0.047s, and no CPU can do a billion iterations that quickly.