[antlr-interest] Profiler 2

Martin Probst mail at martin-probst.com
Fri Dec 2 06:14:52 PST 2005


> 10x?. That's a little way out there. ANTLR C++ parsers aren't that slow
> iirc. Esp. once they are compiled in release mode with optimizations turned
> on. One just needs to remember to use a [f]lex scanner as the sample
> demonstrates.
>
> I wonder what factors came into play on your project.

Well, a keyword free language which made the (ANTLR-generated) lexer
very complex, a programmer that tried to avoid to much hassle by working
around some more complexity in the lexer with ()=> blocks, etc. So no
flex there.

On the other hand, the LALR guy actually wrote his own LALR(1) parser
generation tool for the job. Don't ask me why. Needless to say that my
parser was working, tested & finished in about 1 month and his wasn't
really done after 6 (and of course much more error prone).

My point was not that 10x is really a representative number, but a
naive/quick implementation using only ANTLR (no flex) can be
significantly slower than a LALR parser, without making really stupid
errors on the ANTLR part.

I'm pretty sure that with a hand-coded/flex Lexer and some more
optimisations this would have gone down significantly, and there would
have been plenty of time for that in the 5 month productivity
difference ;-)

Martin



More information about the antlr-interest mailing list