[antlr-interest] Speed (was: build issues: bytecode assembly generation)

John D. Mitchell johnm-antlr at non.net
Fri Oct 22 19:54:36 PDT 2004


>>>>> "Don" == Don Caton <dcaton at shorelinesoftware.com> writes:
[...]

> Yes, like parsers <g>.  In a debug build, it takes my antlr-generated
> (C++) parser about 15 seconds to parse a 77k source file.  With full
> optimizations enabled, the same code finishes in slightly under 2
> seconds.  I'm not kidding.  I was sweating bullets when got my parser to
> work and found it was so slow.

(A) That would be primarily due to slow lexing much more than the parser.

(B) In Antlr v2.x, if you really need lexing speed, you can always create a
flex-based lexer and use that to feed an Antlr-based parser.

(C) In Antlr v3, the generated the DFAs will be both fast and powerful.  As
Ter has mentioned again, the output generation in Antlr v3 is done via
pluggable StringTemplates so things like inlining lookahead or not (extra
speed vs. code size) will be trivial to change.

(D) In real terms, does that 2 seconds vs. 15 seconds really drive your
development style into some sort of major dysfunction?

Take care,
	John

P.S.	In terms of why Antlr v2 is written in Java, Ter and I have both
	talked about the history of this in the past on this list so, the
	curious can search the list archives.


 
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