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

Charles Felstead charles.felstead at gmail.com
Wed Aug 23 12:59:07 PDT 2006


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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20060823/11c4e1fa/attachment.html


More information about the antlr-interest mailing list