[antlr-interest] Is this Recognizer optimization valid?
sander at aqris.com
Tue Oct 2 06:48:13 PDT 2001
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.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the antlr-interest