At 2024-05-10T13:28:40-0400, Paul Winalski wrote:
On Wed, May 8, 2024 at 2:29 PM Douglas McIlroy <
douglas.mcilroy(a)dartmouth.edu> wrote:
Dennis was one-up on Digitek in having a
self-maintaining compiler.
Thus, when he implemented an optimization, the source would grow,
but the compiler binary might even shrink thanks to
self-application.
Another somewhat non-intuitive aspect of optimizing compilers is that
simply adding optimizations can cause an increase in compilation speed
by reducing the amount of IL in the program being compiled. Less IL
due to optimization means less time spent in later phases of the
compilation process.
This fact was rediscovered later when people found that some code
compiled with "-Os" (optimize for space) was faster than some code
optimized for speed ("-O1", "-O2", and so on).
The reason turned out to be that the reduced code size meant fewer cache
evictions, so you gained performance by skipping instances of
instruction fetches all the way from the slow main memory bus.
Think of all those poor unrolled loops...
Regards,
Branden