[antlr-interest] Is this Recognizer optimization valid [more details]
sander at aqris.com
Tue Oct 2 06:55:48 PDT 2001
Did the measurments and original version generated 30% more ASTPair objects.
----- Original Message -----
From: Sander Mägi
Sent: Tuesday, October 02, 2001 3:48 PM
Subject: [antlr-interest] Is this Recognizer optimization valid?
I did some search and replace on my JavaRecognizer.java file (from java.g) to gain speed and memory - it seems to work in my tests.
Maybe someone can confirm that this optimization is indeed correct.
I defined a variable:
private static final ASTPair NULL_PAIR = new ASTPair();
And replaced all occurences of 'new ASTPair()' with '(inputState.guessing==0)?new ASTPair():NULL_PAIR;'
This makes garbage collector very happy and makes program a bit faster too.
Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the antlr-interest