From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=0.2 required=5.0 tests=BAYES_00,INVALID_MSGID, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 1014db,dab7d920e4340f12 X-Google-Attributes: gid1014db,public X-Google-Thread: 103376,dab7d920e4340f12 X-Google-Attributes: gid103376,public From: kdq@emoryi.jpl.nasa.gov (Kevin D. Quitt) Subject: Re: C is 'better' than Ada because... Date: 1996/08/05 Message-ID: <320670b8.275530191@netline-fddi.jpl.nasa.gov>#1/1 X-Deja-AN: 172313046 references: <01bb80f9$5df267c0$9cee6fce@timhome2> content-type: text/plain; charset=US-ASCII organization: Speaking only for Myself mime-version: 1.0 reply-to: kdq@emoryi.jpl.nasa.gov newsgroups: comp.lang.ada,comp.lang.c Date: 1996-08-05T00:00:00+00:00 List-Id: On 3 Aug 1996 05:06:55 GMT, "Tim Behrendsen" wrote: >William Clodius wrote in article >... >> In article <01bb7fd4$6a0f4300$87ee6fce@timpent.airshields.com> "Tim >> Behrendsen" writes: >> I had an [ex-]employee who wrote the slowest code on the face of >> the earth. Not a chance. One guy I knew wrote an I/O driver for an ASR-33 Teletype's paper tape reader that slowed the reader down from 10 CPS to 7.5 CPS. Very impressive since there were no deliberate delay loops. While reasonable C compilers on modern 32 machines emit the same code for equivalent (simple) pointer and array indexing code, the fact is that the use of pointers is one of the things that limits what an optimizer can do; that's why you'll find "assume no aliasing" flags on most C compilers. What's happening to an array in a loop is usually pretty obvious; enough so that compilers can make use of special indexing instructions, pipelining, vectorization, and parallel execution. When pointers are used, and you aren't guaranteed that aliasing can't happen, you can't safely make the same assumptions you can about array indexing. In addition, some mainframes and supercomputers are tuned for array indexing and are *much* better at it than at pointer deferencing. -- #include _ Kevin D Quitt USA 91351-4454 96.37% of all statistics are made up Per the FCA, this email address may not be added to any commercial mail list