[antlr-interest] ANTLR performance

Chrobot, Stefan Stefan.Chrobot at sabre.com
Tue May 11 03:26:53 PDT 2010


>> I'm using ANTLR with the C# target. The generated parser performs too
>> slow for my needs. My grammar uses k = 6.
>>
>> Does it have a performance impact? What value should I target to get
>> optimum performance - 1 or *? Would changing the grammar to 1/* give
>> significant performance boost?
>>
>>    
>Could you try it yourself?
>I mean test it. I would be interested in your results too..


It would probably take a good amount of time to change the grammar and
the actions. I can't invest my time in that. Even more, since I found
that the real performance bottleneck is in my case the use of rewrite
rules, TokenRewriteStream and StringTemplate. I got about 100x
performance boost after disabling the rewriting (leaving my actions in
place). I guess I'll have to do the outputting myself. This will be a
costly task (both implementation and performance-wise), but I suspect
(and truly hope) to get something like 50x performance improvement from
the original solution.


Stefan


More information about the antlr-interest mailing list