[antlr-interest] Re: Performance tweak for .NET antlr library

Matthew Mastracci matt at aclaro.com
Thu Mar 23 09:09:09 PST 2006

Micheal J wrote:

> Using a custom ASTFactory that creates the AST classes directly [i.e. new
> MyAST(...)] is another recommended performance tweak.
> If a project uses one AST class (i.e. homogeneous AST), using a custom
> ASTNodeCreator is a simpler option.

Cool - I didn't know this was possible.  We're just using CommonAST, so 
this should certainly improve things (esp. by avoiding the 
Activator.CreateInstance call).

For the most part, the ANTLR parsers seem to be very high-performance. 
Through my profiling, however, I saw that 75% of the time parsing was 
spent in the constructor of ASTFactor.


More information about the antlr-interest mailing list