[antlr-interest] followup to v3 speed

Terence Parr parrt at cs.usfca.edu
Sat May 27 11:56:34 PDT 2006


Ha!  I knew I was forgetting something.  v3 does much better error  
recovery, but at the cost of a push/pop on a software stack for each  
method call.  When I comment those out, I get

parsing+lexing		3696 ms
lexing:				1503 ms
parsing+lexing+ast	7514 ms

So that means the parsing time is about 2193ms and tree construction  
is about 3818ms.  The relative percentages are now:

lexing	20%
parsing	30%
ast		50%

So, without this extra push/pop, v3 is already 25% faster than v2 for  
java parsing and tree building combined.  If I can get the tree  
building down further, we'll be even faster.  v2 is 2805ms for parsing 
+ast versus 6011ms in v3.  Gotta get that faster.

Now the big question: do I leave in the good error handling by  
default or is that an option?

Ter


More information about the antlr-interest mailing list