[antlr-interest] BENCHMARK. ANTLR. Bad results.
Paul J. Lucas
pauljlucas at mac.com
Fri Nov 12 15:55:25 PST 2004
On Sat, 13 Nov 2004, Ruslan Zasukhin wrote:
> Have you ever open the object of std::string In the debugger.
> For different vendors this class have 2-3 levels of construction.
And most of this is inlined. When you single-step in a
debugger, it goes to the original source line. In reality,
most of the construction is inlined and optimized away.
> std::string class is very overloaded.
I'm not sure what that means, exactly, but the size of the API
has zero correlation to efficiency.
> Let me answer that in our project we DO NOT use any STD classes,
> Because we have prove they are not effective for our tasks... And because we
> always can write own optimized for our task implementation.
You do realize that std::string is actually a template and that
you can plug-in your own underpinning while retaining the
std::string API, right?
> May be ANTLR in the _public_ API which we will use in our apps,
> Should expose just char*. Then "problem" you point will go away.
> If you like std::string in your app no problems
>
> std::string str = antlr::foo_get_token()
And then the problem is right back again: if ANTLR used
std::string internally (or any string) and it converts to char*
and if you use some string class, your object ("str" above) has
to construct itself -- performance hit. Now if ANTLR returned
std::string by reference and you did the assigment above, it's a
simple pointer copy.
- Paul
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