Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utgpu!water!watmath!clyde!cbosgd!mandrill!hal!ncoast!allbery From: allbery@ncoast.UUCP Newsgroups: comp.unix.wizards Subject: Re: Big Programs Hurt Performance Message-ID: <4774@ncoast.UUCP> Date: Wed, 31-Dec-69 18:59:59 EDT Article-I.D.: ncoast.4774 Posted: Wed Dec 31 18:59:59 1969 Date-Received: Fri, 2-Oct-87 06:26:36 EDT References: <1665@ncr-sd.SanDiego.NCR.COM) <8579@utzoo.UUCP) <6886@eddie.MIT.EDU) <1387@osiris.UUCP> <382@pcrat.UUCP> <14000@oddjob.UChicago.EDU> Reply-To: allbery@ncoast.UUCP (Brandon Allbery) Followup-To: comp.unix.wizards Organization: Cleveland Public Access UN*X, Cleveland, Oh Lines: 42 As quoted from <14000@oddjob.UChicago.EDU> by matt@oddjob.UChicago.EDU (Ke Kupua): +--------------- | In article <382@pcrat.UUCP> rick@pcrat.UUCP (Rick Richardson) writes: | ) The half serious thoughts around here: port down the VAX's native C | ) compiler to a . | | This is not the first time I've seen the phrase "VAX's native C | compiler" used here. What would you mean by a vax C compiler that | was not "native"? +--------------- Easy: a pcc-based compiler. Pcc is wonderful for making a single compiler skeleton work on many systems, but the price is that the code is often sub-optimum. A compiler specifically optimized for VAX code would naturally produce faster code than something like pcc, which uses assembler constructs which can easily be configured for a large class of host assemblers but may not generate the most optimum code for a particular processor. Perhaps a good example would be (I don't know if the Vax's pcc optimizes this, since I'm not a Vax hacker, but chances are pretty good that it doesn't): in order to assign two structures, the template used by pcc might be to call a function to do a byte copy, but the Vax has an instruction to do the copy directly, much faster than a subroutine even if the subroutine just invokes the machine language instruction due to stack frame management and call/return overhead. Similar considerations apply to processors which have machine language support for high-level control structures -- such as the 80386 "SETxx" instruction, which allows complex conditions to be computed linearly (Pascal-style conditions, not C `&&' or `||' conditions). Conditions computed with SETxx on the 386 would be faster than pcc's default method using more traditional means, because extra jump instructions in the generated machine code could be avoided. This kind of thing is the reason why e.g. Plexus is now compiling their kernels using the Green Hills native 68020 compiler rather than pcc, as they used previously. And believe me, the difference is noticeable; I was quoted a 20% speed increase in the kernel in the above instance. -- Brandon S. Allbery, moderator of comp.sources.misc {{harvard,mit-eddie}!necntc,well!hoptoad,sun!mandrill!hal}!ncoast!allbery ARPA: necntc!ncoast!allbery@harvard.harvard.edu Fido: 157/502 MCI: BALLBERY <> "`You left off the thunderclap and the lightning flash.', I told him. `Should I try again?' `Never mind.'" --Steven Brust, JHEREG