in reply to Re: Re: Optimizing into the Weird Zone
in thread Optimizing into the Weird Zone
I've studied some hand- optimized ASM compared to the output of GCC, and while the hand-optimized can shave off an instruction or two, it will suffer more if the processor makes a branch misprediction.
That just means the guys that optimised the code generators of the GCC compiler did an excellent job.
So all in all, its better if programmers leave that stuff alone if we can get away with it.
I bet everyone who uses the GCC compiler is glad that it's programmers didn't take a hands-off attitude.
I guess it comes down where in the food chain your code comes. If you know it will always be top predator--consuming memory and cycles--then you can afford to apply no bounds, nor waste effort trying to curtail its appitite. However, if your code needs to live in a competative environment sharing limited resources, and especially if your code lives only part way up the food chain (ie. libraries and modules), then your efforts to limit the consumption by your code will have knock on benefits for every run of every top predator written to use it.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Re: Re: Optimizing into the Weird Zone
by hardburn (Abbot) on Aug 12, 2003 at 20:24 UTC |