Array indexing vs. pointers...

mcdonald at uxe.cso.uiuc.edu mcdonald at uxe.cso.uiuc.edu
Mon Oct 24 02:19:00 AEST 1988


>Besides, most efficiency losses are from poor
>choice of data structures or algorithms, not from fatty source code.
Agreed.... But.....


>Compilers are much better now.  Age has encouraged a modesty which
>allows that the compiler may well know how to do things better than I
>do.  That is certainly the case when I take my code off to some
>unfamiliar computer.

>I have concluded, and I think this is what Doug<Gwyn - not me> is saying, 
>that one
>should not code in a way that will confuse either the reader of the
>code or the compiler.

>If your compiler doesn't do a good job of optimization then your money
>probably is spent better on a better compiler than it is on the time
>of coders diddling with the code.
Yes.... But.....

Sometimes the better compiler doesn't yet exist. An example is for
the 80386. So far no one is selling a 386 compiler that produces
code for MS-DOS (NOT, I should say, for 386 native mode, but one that
allows using 32 bit instructions in REAL mode - yes, you really can
do that!). By having my C compiler emit .asm output and replacing
5 lines of C with real 32 bit instructions I was able to speed up
a program by an astounding 40%! That is worth doing.

Microsoft - where is that /G3 compiler switch - it is long overdue!

Doug McDonald



More information about the Comp.lang.c mailing list