Re: Flex speedup

Robert Sherry <>
10 Feb 2000 01:17:26 -0500

          From comp.compilers

Related articles
Flex speedup amorgan@Xenon.Stanford.EDU (2000-02-05)
Re: Flex speedup (Robert Sherry) (2000-02-10)
| List of all articles for this month |

From: Robert Sherry <>
Newsgroups: comp.compilers
Date: 10 Feb 2000 01:17:26 -0500
Organization: @Home Network
References: 00-02-018
Keywords: lex, performance

My experience with scanner generates is mixed. In general, I have
found that for production work a hand written scanner will run
significantly faster.

If you are using flex and you want better performance I would
try to merge rules. Let me illustrate what I mean. Often you might
have one rule for identifiers, and one rule for each reserved word.
The assumption here, is that identifiers can not be reserved words. I
would merge those rules into one rule, and use some type of hashing
scheme. By the way, since the number of reserved words is fixed, I
have found that closed hashing will work better then open hashing in
this case.

I might be able to provide additional information, if I knew
more about the language you are tring to process. I hope this helps.

Robert Sherry

Alan Morgan wrote:
> I'm trying to squeeze all the performance I can out of flex (without
> resorting to the "don't use flex" strategy").

Post a followup to this message

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