C "optimization" (6 of 8)

Dan Klein dvk at mi-cec.UUCP
Mon Feb 20 06:35:01 AEST 1984


A response to Morris Keesan:

	Having a compiler discard instructions that are superflous is not a
"fatuous" desire.  If you go ahead and count the number of instructions that
are required to supress a ".data" / ".text" pair (probably on the order of
10 instructions), and the amount of code required to write the things out,
go through system buffers, get written out to the disk, read back again by the
next pass, moved back though the buffers, scanned, checked in lookup tables,
evaluated, (ignored), and then add in the (minimum) 5 or 6 context swaps, you
begin to see that removing the instructions is **FAR** cheaper than writing
them out.  Not only that, but if I/O is blocked, the process is eligible to
be swapped out, which slows you down even more.

	No, the example was not fatuous.  Try running on a system with a load
of 20 (it happens a *lot* on cmucsg), and you tell me which approach wins.

		-Dan Klein, Mellon Institute, Pittsburgh



More information about the Comp.lang.c mailing list