[antlr-interest] More, Status of C++ backend?

Mark Wright markwright at internode.on.net
Tue Jan 1 18:49:21 PST 2008


> 2) also I have come to all these issues because again did profile of
> 100K-1M INSERTS, and I see big troubles in ANTLR 2.7.2 C++ runtime.
> As far as I could see problem come from LA() which calls a lots
> NextToken() which creates std::string() what cause call of new() (and
> later free.
> 
> ANTLR parser looks to work 8-10 times slower of YACC or Lemon. And I
> think because of this reason.
> 
> I have check -- and it seems to be deal of few hard days work to try
> remove std::string from C++ runtime of ANTLR 2.7.2 and using instead
> just pair  { char*, length }
>     where char* points right into string we do parse.
>     I do not see any need today do COPY of each token string.
>     btw, how you have implement this in C runtime for v3 ?

Hello Ruslan and Jim,

Another idea is:  maybe it might be easier to find a way to optionally
plug in Andrei Alexandrescu's flex_string instead of std::string.
flex_string is used in the Boost Wave project, presumably for the
same reason.

Thanks, Mark

-- 


More information about the antlr-interest mailing list