Path: utzoo!utgpu!water!watmath!clyde!att!osu-cis!tut.cis.ohio-state.edu!cwjcc!hal!nic.MR.NET!tank!uxc!uxc.cso.uiuc.edu!uxg.cso.uiuc.edu!uxe.cso.uiuc.edu!mcdonald From: mcdonald@uxe.cso.uiuc.edu Newsgroups: comp.lang.c Subject: Re: Array indexing vs. pointers... Message-ID: <225800082@uxe.cso.uiuc.edu> Date: 23 Oct 88 16:19:00 GMT Lines: 32 Nf-ID: #R:<8809191521.AA17824@ucbvax.Berke:-40:uxe.cso.uiuc.edu:225800082:000:1279 Nf-From: uxe.cso.uiuc.edu!mcdonald Oct 23 11:19:00 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 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