[antlr-interest] Performance of ANTLR-generated lexer/parsers

Loring Craymer lgcraymer at yahoo.com
Wed Aug 23 13:40:24 PDT 2006


Replace the lexer with a flex-based one; lexing is where the biggest performance hit with ANTLR 2 is.

--Loring

Charles Felstead <charles.felstead at gmail.com> wrote: Hello,
 
 I've used ANTLR 2.7.6 to create a C++ parser for a simple XML file. The goal was to compare some metrics with a Xerces-C++ parser (uses DOM). 
 
 The first thing we found out (as we expected) is that the ANTLR-generated parser is much MUCH smaller in static footprint. Regarding the dynamic footprint, we know the Xerces-based parser uses more memory...but we don't have all the numbers yet.
 
 Now what really surprised us is the speed of the parsers. We were expecting the ANTLR-generated parser to be much faster than the Xerces-based parser. After all, the ANTLR parser is specific to that one type of file I'm parsing whereas the Xerces is generic. Turns out the Xerces parser, is about 15-25% faster than the ANTLR one??!
 
 So, my question is, can I flip some switches or configure the ANTLR-generated parser to improve the performance??
 
 Thanks,
 Charles.
 

 				
---------------------------------
Do you Yahoo!?
 Next-gen email? Have it all with the  all-new Yahoo! Mail.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20060823/0563b1ed/attachment.html


More information about the antlr-interest mailing list