[antlr-interest] Parser performance

Terence Parr parrt at cs.usfca.edu
Fri Mar 19 17:25:08 PST 2004


On Mar 19, 2004, at 2:27 PM, Donovan, Bob wrote:
> I just finished testing a new parser that I generated with ANTLR.
>
> The parser will parse the grammar, build and AST, and walk the AST to 
> generate some statements that I use to update a model.
>
> When I compare the performance of the antlr generated parser vs an 
> older parser that i wrote by hand, I find that my older parser was 
> twice as fast
>
> ANTLR: 44 seconds
> OLDER: 16 seconds
>
> I really expected the ANTLR parser to run just as fast or maybe even 
> faster. Not sure why it is slower.
> I optimized the ANTLR parser by putting the most common rules in front 
> of less common rules.

I think the lexer is to blame.  Should be able to double speed 
according to tests done by a friend...I just can't make them general 
enough fast enough for 2.7.3...my energy is devoted to 3.0 and making 
it fast as @&&*(@#%#($.

Ter
--
Professor Comp. Sci., University of San Francisco
Creator, ANTLR Parser Generator, http://www.antlr.org
Cofounder, http://www.jguru.com
Cofounder, http://www.knowspam.net enjoy email again!
Cofounder, http://www.peerscope.com pure link sharing





 
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