[antlr-interest] Is this Recognizer optimization valid?

Terence Parr parrt at jguru.com
Sun Oct 7 15:45:14 PDT 2001


On Wednesday, October 3, 2001, at 08:07  AM, Sander Mägi wrote:

> The ASTPair hack gave some 30% reduced garbage and 20% increased speed 
> (on my anyway handoptimized lexer and recognizer)

My $0.02 here.  The real way to optimize this is to do awy with the 
ASTPair in favor of two local variables.  No mem 
allocation/deallocation.  At the cost of some inline code (since I would 
remove the surrounding object ASTPair), currentAST could be converted to 
currentAST_root and currentAST_child.  The resulting inlined code would 
increase code size (but hopefully not that much).

Ter
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: text/enriched
Size: 664 bytes
Desc: not available
Url : http://www.antlr.org/pipermail/antlr-interest/attachments/20011007/ebb4ab01/attachment.bin


More information about the antlr-interest mailing list