[antlr-interest] Hand made lexer 600(!!!!!) times faster ofANTLR'sone

Loring Craymer Loring.G.Craymer at jpl.nasa.gov
Thu Feb 24 04:16:32 PST 2005


[snippage]
> > Really, It is easy to see that during parsing we build tree,
> > then we kill the whole tree. So having own allocator in ANTLR
> > it is possible kill the whole tree not as million of delete
> > calls, but as single call to destroy the whole heap.
> 
> Agreed.
> 
> On a related note, I'm interested in ideas about if and how something
> similar can be achieved in managed langauges (i.e. Java/C#) or do we have
> to
> trust the GC?

No--you can recycle nodes by returning them to the factory which then keeps
a "free" list of available nodes.  That is not easily implemented in ANTLR
2--hetero-ASTs cause problems--but in ANTLR 3 you should be able to recycle
carriers.

--Loring

> 
> Micheal



More information about the antlr-interest mailing list