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

Christopher Schultz christopher.d.schultz at comcast.net
Sat Feb 26 08:22:42 PST 2005


Michael,

> 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?

You simply have to trust the GC in Java. But, you can cheat a little and
give the GC some help. For example, you can store things in arrays (or a
single, big array) instead of more complex structures. Then, you can
discard the array and the GC doesn't have to either mark-and-sweep
(yuck!) or process tons of objects through the generational collector.
Sure, if you have lots of little String and Integer objects lying
around, it'll still have to process them, but if you have each of those
wrapped-up inside other objects, and still other objects, it takes a
while to clean-out the heap.

For C#, you can always use managed code if you want to stay in the C#
realm. Don't forget that for all .NET runtime-based classes, it doesn't
matter what language was used to write the component... it's available
from all languages. So, you could write the .NET code generator to emit
managed C++ or Managed C (does that exist?) and you'll have much greater
control over your memory allocation and deallocation.

-chris
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 254 bytes
Desc: OpenPGP digital signature
Url : http://www.antlr.org/pipermail/antlr-interest/attachments/20050226/3a7f90b3/signature.bin


More information about the antlr-interest mailing list