[antlr-interest] Performance Exploration (C++ Library)

Ric Klaren ric.klaren at gmail.com
Tue Dec 14 07:33:34 PST 2004


Hi,

On Tue, 14 Dec 2004 10:01:42 -0500, Bryan Ewbank <ewbank at gmail.com> wrote:
> There was a discussion here a while back -- wrapped up on 2004.10.26
> by Don Caton -- about where performance is being lost, and a general
> theory that replacing the scanner with lex would help quite a bit:
> 
>          http://article.gmane.org/gmane.comp.parsers.antlr-interest/1283
> 
> Well, I was curious (and there's a very good C++ example - thanks
> Ric!), so I replaced my ANTLR scanner with lex.   Using gprof, I
> learned that I saved around 10%.  That's okay, I guess.  Not what I'd
> hoped for, but good enough to switch.

Only 10%? Hmm would have expected more going on some other figures I
heart about.

> What surprised me is that the stuff associated with antlr::ASTRefCount
> accounted for nearly 40% of the time reported in gprof.  On the one
> hand, this makes some sense (the "forwarding" methods account for
> around 15% of overall time) - but I was surprised to see assignment
> taking nearly 10% of the time.

Ah looks like you use a lot of treewalker stuff. But... Ugh. I'm
currently tinkering with the refcounters for 2.7.5 release (trying to
make things play nice with the ones contributed by Mark Lentzcer (sp?)
) Anycase I'm more and more of the opinion that I *really* want to get
rid of these damn things, and that was without looking at the
performance picture which you now provide (thanks!)

The one thing I'm currently worried about is backwards compatability
for the 2.7.5 release I had planned to release with the new reference
counter, but I'm at a point that I'm inclined to back out all those
changes and release 2.7.5 with the old ones. (It just feels like
shuffling the problem around to other parts of the code)

Also if I include the new ones we'll be dropping MSVC6 support.

Cheers,

Ric


 
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