Re: Folk Theorem: Assemblers are superior to Compilers

"Julian V. Noble" <jvn@fermi.clas.virginia.edu>
Fri, 29 Oct 1993 15:43:36 GMT

          From comp.compilers

Related articles
[12 earlier articles]
Folk Theorem: Assemblers are superior to Compilers Mark_Prince@gec-epl.co.uk (1993-10-28)
Re: Folk Theorem: Assemblers are superior to Compilers mps@dent.uchicago.edu (1993-10-28)
Re: Folk Theorem: Assemblers are superior to Compilers toon@moene.indiv.nluug.nl (1993-10-28)
Re: Folk Theorem: Assemblers are superior to Compilers raymondc@microsoft.com (1993-10-28)
Re: Folk Theorem: Assemblers are superior to Compilers adk@sun13.SCRI.FSU.EDU (1993-10-29)
Re: Folk Theorem: Assemblers are superior to Compilers elliottm@csulb.edu (1993-10-29)
Re: Folk Theorem: Assemblers are superior to Compilers jvn@fermi.clas.virginia.edu (Julian V. Noble) (1993-10-29)
Re: Folk Theorem: Assemblers are superior to Compilers Freek.Wiedijk@phil.ruu.nl (1993-10-29)
Re: Folk Theorem: Assemblers are superior to Compilers synaptx!thymus!daveg@uunet.UU.NET (Dave Gillespie) (1993-10-29)
Re: Folk Theorem: Assemblers are superior to Compilers rfg@netcom.com (1993-10-30)
Re: Folk Theorem: Assemblers are superior to Compilers qualtrak@netcom.com (1993-10-30)
Re: Folk Theorem: Assemblers are superior to Compilers johnson@cs.uiuc.edu (1993-10-31)
Re: Folk Theorem: Assemblers are superior to Compilers henry@zoo.toronto.edu (1993-10-31)
[9 later articles]
| List of all articles for this month |
Newsgroups: comp.compilers
From: "Julian V. Noble" <jvn@fermi.clas.virginia.edu>
Keywords: assembler, performance
Organization: University of Virginia
References: 93-10-134
Date: Fri, 29 Oct 1993 15:43:36 GMT

Everyone agrees one should profile one's code, if speed is important. In
many cases one does not even need a profiler because the bottlenecks in
the algorithm are obvious. For example, in a FFT, don't bother using ass'y
to code the table f(k) = exp[2 i pi k / N ] because it is an O(N) process.
Just optimize the inner loop. Similarly, in Gaussian elimination (or in
the LR decomposition) for linear equations, the inner loop code is
executed N^3 times, everything else N^2 or less, so optimize that loop
(it's a short one, too).


The chief bottleneck in hand-optimizing code is the assemble-link-test
cycle. One reason I prefer FORTH to other languages is the built-in
assembler eliminates this step: words defined in assembler execute like
any others, hence can be tested immediately, etc. etc.


I have not yet had the opportunity to try this for a RISC chip, but for
the 80x86 and MC680x0 -based machines this peephole hand optimization
beats anything compilers produce. --jvn
--
Julian V. Noble
jvn@virginia.edu
--


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.