Re: is lex useful?

raph@kiwi.cs.berkeley.edu (Raph Levien)
26 Jun 1996 11:41:19 -0400

          From comp.compilers

Related articles
[4 earlier articles]
Re: is lex useful? kelley@Phys.Ocean.Dal.Ca (1996-06-24)
Re: is lex useful? Scott.Nicol@infoadvan.com (1996-06-24)
Re: is lex useful? kanze@lts.sel.alcatel.de (1996-06-24)
Re: is lex useful? bos@serpentine.com (1996-06-26)
Re: is lex useful? dhami@mdd.comm.mot.com (1996-06-26)
Re: is lex useful? stefan.monnier@lia.di.epfl.ch (Stefan Monnier) (1996-06-26)
Re: is lex useful? raph@kiwi.cs.berkeley.edu (1996-06-26)
Re: is lex useful? rgreen@barach.bbn.com (1996-06-26)
Re: is lex useful? leichter@smarts.com (Jerry Leichter) (1996-06-27)
Re: is lex useful? scooter@mccabe.com (Scott Stanchfield) (1996-06-27)
Re: is lex useful? Scott.Nicol@infoadvan.com (1996-06-27)
Re: is lex useful? Scott.Nicol@infoadvan.com (1996-06-27)
Re: is lex useful? 72510.2757@CompuServe.COM (Stephen Lindholm) (1996-06-27)
[12 later articles]
| List of all articles for this month |

From: raph@kiwi.cs.berkeley.edu (Raph Levien)
Newsgroups: comp.compilers
Date: 26 Jun 1996 11:41:19 -0400
Organization: University of California, Berkeley
References: 96-06-073 96-06-094
Keywords: lex, performance

>[Has anyone actually timed a flex scanner vs. a hand-coded one? -John]


      This was a homework project in Berkeley's graduate compiler class
in the fall of '92. My measurements indicated that the hand-coded
version was about 60% faster than the flex version.
      The language was a pretty good subset of Modula 3, i.e. with almost
all of the lexical structure. I tried to optimize the hand-coded case
for raw speed. It turned out to be about 900 lines of code.
      In both cases the performance was very good - flex went through
about 1MB/sec, while the handcoded version achieved 1.6MB/s. In both
cases, this is likely to be faster than the rate at which the program
can be read from disk (it was in cache for the measurements). These
measurements were taken on an HP 7000 workstation running HPUX 8
(state of the art for 1992).


      A reasonable conclusion would be that the speed penalty for using
flex would almost never affect the total performance of a compiler or
interpreter.


Raph
--


Post a followup to this message

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