Newsgroups: comp.lang.c
Path: utzoo!henry
From: henry@utzoo.uucp (Henry Spencer)
Subject: Re: const, volatile, etc [LONG]
Message-ID: <1988Dec5.214604.5995@utzoo.uucp>
Organization: U of Toronto Zoology
References: <674@quintus.UUCP> <117@halcdc.UUCP> <468@auspex.UUCP> <9016@smoke.BRL.MIL> <10919@ulysses.homer.nj.att.com> <9033@smoke.BRL.MIL> <319@aber-cs.UUCP>
Date: Mon, 5 Dec 88 21:46:04 GMT

In article <319@aber-cs.UUCP> pcg@cs.aber.ac.uk (Piercarlo Grandi) writes:
>...C has been beautifully designed so as to allow for a simple
>compiler that does not do aggressive code optimization...

However, it is a verifiable fact that in general your code runs faster
if your C compiler does aggressive optimization.  Many (not all) of
the things an optimizer can do can be done by a C programmer, *if* he
has enough time and patience to do a lot of fussy, boring bit-picking.
In practice, programmers understandably prefer to leave that to the
compiler, and simply don't bother doing it if the compiler can't.

Another point which should not be overlooked is that code that has been
micro-optimized in this fashion tends to be (a) quite machine-specific
(it may work on another machine, but the micro-optimizations will be
all wrong), and (b) grossly unreadable.
-- 
SunOSish, adj:  requiring      |     Henry Spencer at U of Toronto Zoology
32-bit bug numbers.            | uunet!attcan!utzoo!henry henry@zoo.toronto.edu