[antlr-interest] Performance and LA(int)

Don Caton dcaton at shorelinesoftware.com
Thu Feb 24 15:11:01 PST 2005


Brian:

> -----Original Message-----
> From: antlr-interest-bounces at antlr.org 
> [mailto:antlr-interest-bounces at antlr.org] On Behalf Of Bryan Ewbank
> Sent: Thursday, February 24, 2005 5:28 PM
> To: ANTLR Interest
> Subject: Re: [antlr-interest] Performance and LA(int)
> 
> Can't the code here be refactored so that it's 90% 
> inlineable, with the small differences spun off into 
> functions?  It seems this is a classic refactoring, though I 
> can't remember the name of the refactoring pattern...

Yep, it can and it makes a huge difference in performance.  The whole Antlr
runtime could be implemented as inline headers, although most of the
performance gains seem to be in the CommonToken and CommonAST classes.

The name of the refactoring pattern is called "tweaking the code".  Never
understood why this industry always has to come up with geeky names to
describe a simple thing that we've all been doing for decades.

Regards,
 
Don




More information about the antlr-interest mailing list