[antlr-interest] Re: BENCHMARK. ANTLR. Bad results.

lgcraymer lgc at mail1.jpl.nasa.gov
Fri Nov 12 15:53:19 PST 2004



--- In antlr-interest at yahoogroups.com, Ruslan Zasukhin <sunshine at p...>
wrote:
[dismal performance figures snipped]

> Just I want to demonstrate that my expectation of bad performance of C++
> ANTLR runtime have become reality.
> 
> * We will try urgently switch to Lex lexer.
> 
> * but IMHO on of the main problems of ANTLR C++, is that it heavally
uses
> std::string class and a lots of *copying* of string when it parse
tokens.
> * may be another problem is in exceptions, although I like mechanizm of
> exceptions. 
> 
> I think that for 3.0 Rick and community should produce own, special,
very
> optimized for ANTLR tasks antl::string class. This class should
simply have
> 2 pointers on start/end of tokem. Pointer must point directly into
original
> parsed text. There is no need copy any byte of parsed text.
Everything must
> work on pointers. Tell me that I am wrong?! :-)

Ruslan--

Performance is very much a concern for ANTLR 3--check out the "trees
with payloads" thread.  ANTLR 2 does much way too much data copying
and object creation/deletion, starting in the lexer but also in the
parser and treewalkers.  I don't think that a special string class is
needed, although payload objects should support alternative
representations via a start/end reference/pointer and a string
reference/pointer that would be set by getText() and setText()
(getText() would also do string creation, if necessary and set the
string reference field).  Ter's DFA work which led him to the LL(*)
approach began with his looking into how to improve ANTLR lexing
performance.

I hope that the shift to flex helps enough.  What does profiling show?

--Loring

> 
> 
> -- 
> Best regards,
> Ruslan Zasukhin      [ I feel the need...the need for speed ]
> -------------------------------------------------------------
> e-mail: ruslan at p...
> web: http://www.paradigmasoft.com
> 
> To subscribe to the Valentina mail list go to:
> http://lists.macserve.net/mailman/listinfo/valentina
> -------------------------------------------------------------





 
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