3 ms·
Almost everywhere (Linux kernel included IIRC) use -Os now as the effects of the memory hierarchy are much more important than raw instructions per second. A sa
by hosay123 14y ago
Almost everywhere (Linux kernel included IIRC) use -Os now as the effects of the memory hierarchy are much more important than raw instructions per second. A saved stall is worth hundreds of instructions
- mich41 14y agoLinux defaults to -O2, -Os can be switched with CONFIG_CC_OPTIMIZE_FOR_SIZE. Arch Linux doesn't enable it, dunno about others. -Os isn't a silver bullet since it enables use of some high level instructions which may be implemented less efficiently on modern CPUs and reduces code alignment possibly causing some short functions or loops to span multiple cache lines.