Mail Archives: djgpp/1997/01/06/23:13:04
On Mon, 06 Jan 1997 16:03:35 -0800 Dan Mintz <danmintz AT ix DOT netcom DOT com>
writes:
>> Here I go into tirade mode. Not directed at you, but more toward
Please don't. You stop thinking clearly when you do.
>> programming book writers in general. The big problem is that they
>> make novices think that a compiler is incapable of optimizing
>something
>> as simple as a putpixel routine. There is no reason to resort
It is. As I recall, the code was written for Borland C (though I haven't
seen the book in a while...)
>> Run GCC on that and look at the output. Compare it to the above.
>GCC's
>> output is better! (Using mul to multiply by a constant! Get real!)
Of course it is. I have yet to see a compiler that really stacks up to
gcc - this doesn't need pointing out :)
>> "Tricks of the Game Programming Gurus," heh. More like "Tricks of
>the
>> Writers Who Don't Know Anything About Programming."
Wrong - if people would bother _reading_ the book, they would see that
the whole point was to give a firm understanding of a simple method. The
above was used to show how to simply put a pixel, and then an example
translation into assembly. I believe it was somewhere around chapter 20
or 21 (although I'm not quite sure) where they discuss quite a few good
optimization techniques.
- Raw text -