[antlr-interest] Lexer speed comparison

Robin Debreuil robin at debreuil.com
Wed Feb 25 18:26:00 PST 2004


I understand it might not be possible, but it would be really be interesting
to look at your different grammars and see what you have done (or others
would do) to try to optimize and speed things up. I have what is probably
the worlds slowest C# lexer/parser right now, and I've been scouring google
for hints...

Cheers,
Robin



----- Original Message -----
From: "Uli Bubenheimer" <yahoogroups.10.ulibube at spamgourmet.com>
To: <antlr-interest at yahoogroups.com>
Sent: Wednesday, February 25, 2004 4:59 PM
Subject: [antlr-interest] Lexer speed comparison


> I ran some tests comparing Lexers generated by different tools in
> terms of speed. The sophistication of my Lexer specification that I
> used as input for the Lexer generators is about that of a lexer for C.
> The average numbers I found by repeatedly running the generated lexers
> on a large source file were these:
>
> ANTLR           8300ms
> JLex            6500ms
> JFlex 1.4pre5   2000ms
> Flex            1900ms
>
> I used current versions of all tools. For the ANTLR comparison I had
> to adjust the Lexer specification, but tried to make it as efficient
> as possible. For the Flex comparison, I basically called Flex's
> yylex() function from Java via JNI. Also in the case of Flex I
> generated fewer Java objects as output than for the others, and if I
> take that into account, Flex's time would probably be more similar to
> JFlex's.
>
> I was surprised to find that ANTLR generated the slowest lexer.
> Naturally, when interpreting these numbers keep in mind that the
> outcome may have been different on a different lexer specification or
> lexer input text. On the other hand, it makes sense to me that a DFA
> would be faster on average than a more powerful recursive-descent parser.
>
> Are there other performance numbers available? I have not been able to
> dig up anything substantial. I also wonder how ANTLR-generated LL(k)
> parsers perform compared to LALR(1) parsers.
>
> Uli
>
>
>
>
>
> Yahoo! Groups Links
>
>
>
>
>
>



 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
     http://groups.yahoo.com/group/antlr-interest/

<*> To unsubscribe from this group, send an email to:
     antlr-interest-unsubscribe at yahoogroups.com

<*> Your use of Yahoo! Groups is subject to:
     http://docs.yahoo.com/info/terms/
 



More information about the antlr-interest mailing list