Code alignment matters more than code size for performance
The conventional wisdom that smaller code is always better has been thoroughly invalidated on modern processors. A statement from kernel development circles captured this well: for performance-critical paths like interrupt handlers, large-but-correctly-aligned-and-optimized code consistently outperforms byte-packed alternatives. Consider this comparison: mov eax, [foo] add eax, 1 mov [foo], eax versus: inc [foo] The three-instruction sequence…
