Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!swrinde!cs.utexas.edu!sun-barr!rutgers!cmcl2!kramden.acf.nyu.edu!brnstnd From: brnstnd@kramden.acf.nyu.edu (Dan Bernstein) Newsgroups: comp.lang.c Subject: Re: Some optimization results Message-ID: <3072:May700:46:3691@kramden.acf.nyu.edu> Date: 7 May 91 00:46:36 GMT References: <444@smds.UUCP> <186@shasta.Stanford.EDU> Organization: IR Lines: 25 In article <186@shasta.Stanford.EDU> shap@shasta.Stanford.EDU (shap) writes: > >(a) Make arrays static or malloced; don't make them automatic. > Don't bother. Get a serious compiler. ``> (a) Write fast programs.'' ``Don't bother. Get a Cray.'' Unfortunately, buying a Cray will only help code that is never used on another machine. Similarly, getting a better compiler will only help code that is distributed in binary form for that machine, or is not distributed at all. I find both pieces of advice remarkably counterproductive, as they take time away from serious thought about optimization. > More to the point, use the memcmp() or bcmp() routines. They are probably > better suited to the problem because they are hand-tuned to the system > at hand. Piercarlo's study some time back proved otherwise. > In general, the compiler is probably good at unrolling. Most compilers can't unroll anything. ---Dan