3 ms·
esr, brilliant as always. However: since shipping the first version of this guide I have been asked why, if reordering for minimal slop is so simple, C compil
by Annatar 10y ago
esr, brilliant as always.
However:
since shipping the first version of this guide I have been asked why, if reordering for minimal slop is so simple, C compilers don’t do it automatically. The answer: C is a language originally designed for writing operating systems and other code close to the hardware. Automatic reordering would interfere with a systems programmer’s ability to lay out structures that exactly match the byte and bit-level layout of memory-mapped device control blocks.
If the programmer wants or needs absolute control, just do not provide the reordering option to the optimizing compiler. So why wouldn't compilers provide a command line option to do automatic reordering?
- qwertyuiop924 10y agoBrilliant, but crazy.