Path: utzoo!attcan!utgpu!utstat!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!ucbvax!hplabs!hp-ses!hpcea!hpnmdla!waynec From: waynec@hpnmdla.HP.COM (Wayne Cannon) Newsgroups: comp.sys.ibm.pc Subject: Re: High- vs. low-level languages (Was: Re: Why unix doesn't catch on) Message-ID: <340001@hpnmdla.HP.COM> Date: 13 May 89 05:10:16 GMT References: <664@tukki.jyu.fi> Organization: HP Network Measurements Div, Santa Rosa, CA Lines: 42 Re: Optimizing Compilers vs Assembly Programming for Performance As long as C has been around, it is still in its youth when it comes to optimization. I was really disappointed in the sloppy code (both speed and space) generated by the C compilers from several UNIXs (UNICES?) and DOS (pre MS C 5.0) only three years ago compared with a locally written compiler for a non-standard ALGOL-like language. Now that C has become an almost universally used language and not just a language for UNIX hackers and students, companies are willing to invest real resources into optimizing compilers for C. Until just a few years ago, most C compilers were designed for portability (or simply ported from portable C compilers!), not efficiency. FORTRAN is one of a very few languages with truly excellent optimizing compilers. A good optimizing compiler can beat assembly programming, and it has been shown in several challenges between programmers -- one of which was written up several years back regarding a challenge sponsored by some folks at IBM. Numerous experienced FORTRAN and assembly programmers were given the same problem to solve. The FORTRAN programmers beat the assembly programmers every time in terms of execution speed. However, given the code generated by the FORTRAN compiler, the assembly programmers were able to improve upon the code by about 10%. The examination of the differences indicated that the high-level programmers' were able to concentrate more on algorithmic efficiencies at every implementation level and were not as distracted by implementation details as the assembly language programmers. Many assembly programmers challenge this and invoke incantations of initial PDL designs, macro-packages, and subroutine re-use which simply goes to make my point (they are simply lifting themselves up toward high-level language programming by doing so). The best programmers use all the tools they have to do the best job, including assembly language reprogramming of critical sections of code if other factors permit. I am not sure that optimization in today's C compilers are yet up to the level that FORTRAN attained, but I am convinced that we will be there again soon.