[antlr-interest] Re: Exception tests eat performance?

Anton Safonov anton.safonov at refactorit.com
Fri Jan 9 07:11:50 PST 2004


My two bits - in RefactorIT we succeeded to speed antlr up many times.
Generated lexer was frozen at some point and the changes and 
optimizations were hardcoded :( Unfortunately nobody remembers anymore 
what exactly was done there, but I have CVS logs at hand :)  May be I 
will post some hints when will be upgrading to 3.0.

As for the parser, intermediate class was introduced and the original 
generated parser class is postprocessed in Ant target by replacing some 
strings:
- extends clause - replaced LLkParser with our superclass
- tokens are read altogether into array and consume(), LL() & LT() etc. 
work with the array
- ASTPair is stored in a pool and not generated in every rule
- LA(1) is replaced with a field usage
...
just take a look inside with a proper profiler

Good luck!
Anton
RefactorIT - www.refactorit.com

On Wed, 7 Jan 2004 12:48:24 Terence Parr  wrote:

>On Wednesday, January 7, 2004, at 11:40  AM, Karl Meissner wrote:
>  
>
>>>They don't work for primitives in Java unfortunately.
>>>      
>>>
>>Of couse.
>>
>>ResultInfo would be a object.
>>    
>>
>
>Yeah, been thinking of doing this so that we can have multiple return 
>values like PCCTS had.  Also, I need to add a new and improved 
>attribute mechanism that Monty/Loring/I came up with this Summer.
>
>  
>
>>whew!
>>did not mean to start a flame war.
>>    
>>
>
>Sorry if I'm being abrupt...moving to my new place this week and i'm in 
>administrative and packing hell!  Getting only a few snippets to time 
>to look at email. :)
>
>  
>
>>btw Terr,  I like antlr a lot.  Thanks.
>>    
>>
>
>At your service :)
>
>  
>
>>I am using it in product that is close to shipping.
>>    
>>
>
>Excellent!
>
>  
>
>>So I am starting to think about speedups.
>>    
>>
>
>Yeah, me too...the lexer could also be a problem...
>
>Ter
>  
>



 

Yahoo! Groups Links

To visit your group on the web, go to:
 http://groups.yahoo.com/group/antlr-interest/

To unsubscribe from this group, send an email to:
 antlr-interest-unsubscribe at yahoogroups.com

Your use of Yahoo! Groups is subject to:
 http://docs.yahoo.com/info/terms/ 




More information about the antlr-interest mailing list