4 ms·
> False. Loop unrolling is always faster. Blatantly false, which is why heuristics decide when to unroll. Large code trashes instruction caches, and cache mis
by arghwhat 6y ago
> False. Loop unrolling is always faster.
Blatantly false, which is why heuristics decide when to unroll.
Large code trashes instruction caches, and cache misses are very expensive. More code, more misses.
For very small loops, the unroll can pay off, but these are often too small to have significant size detriment.