Re: Speed of lex generated scanners???

bazyar@netcom.com (Jawaid Bazyar)
Sun, 29 May 1994 03:10:05 GMT

          From comp.compilers

Related articles
Speed of lex generated scanners??? rtrigg@crl.com (1994-05-26)
Re: Speed of lex generated scanners??? bazyar@netcom.com (1994-05-29)
Re: Speed of lex generated scanners??? wgsteven@undergrad.math.uwaterloo.ca (1994-05-30)
Re: Speed of lex generated scanners??? peter@csg.uwaterloo.ca (1994-05-30)
Re: Speed of lex generated scanners??? michi@km21.zfe.siemens.de (1994-06-01)
Re: Speed of lex generated scanners??? euambn@eua.ericsson.se (1994-06-06)
| List of all articles for this month |
Newsgroups: comp.compilers
From: bazyar@netcom.com (Jawaid Bazyar)
Keywords: flex, performance
Organization: NETCOM On-line Communication Services (408 261-4700 guest)
References: 94-05-114
Date: Sun, 29 May 1994 03:10:05 GMT

rtrigg@crl.com (Roger Trigg) writes:


>I'm curious about the performance of lex generated scanners. I've done
>some small preliminary benchmarks and the results were not to my liking. A
>fairly simple table driven (large tables, greater than 5K), handwritten
>scanner performed approximately 10 times faster than a lex generated
>scanner.


    I just finished writing a UNIX-based assembler for the 65816 processor.
The original lexer/parser was hand-coded, and was fast. I eventually got
tired of the bugs in my hand-coded rendition of the 816 addressing mode
syntax, and so I experimented with a flex/bison version. Two hours later,
I had a bug-free parser that supported all the addressing modes, and ran a
bit _faster_ than my hand-coded one. I don't remember if I used flex's
"fast" option, but I probably did. The code wasn't any larger, either.


    In any event, I'd have accepeted a slight speed hit in exchange for the
greatly reduced amount my _human_ time, but was pleasantly surprised at
the results.


--
  Jawaid Bazyar
  Procyon, Inc.
  bazyar@netcom.com
  P.O Box 620334
  Littleton, CO 80162-0334 (303) 781-3273
--


Post a followup to this message

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