[antlr-interest] Re: Generated C++ Parser Performance
lgcraymer
lgc at mail1.jpl.nasa.gov
Tue Mar 16 00:57:10 PST 2004
Ruslan--
The lexer is the part of ANTLR most in need of optimization--many very
small methods (a likely source of differences), unoptimized memory
usage, and so on. Function call overhead is less likely to be a
problem in the parser--function bodies are larger--although memory
management could still be an issue. Object creation/destruction could
also be a contributing factor, but that would show up as method
overhead--C++ does a lot of object create/delete in method calls
because of the mix of call by reference and call by value that occurs
with little programmer awareness.
Anyway, call it an educated guess. I could be wrong; however,
replacing the lexer is an easy way to improve performance.
--Loring
--- In antlr-interest at yahoogroups.com, Ruslan Zasukhin <sunshine at p...>
wrote:
> On 3/16/04 8:48 AM, "lgcraymer" <lgc at m...> wrote:
>
> > I'd bet on the lexer then. The only other likely sources of slowdown
> > memory are memory management--a custom allocator for ASTs might
> > help--and exceptions (syntactic predicates). Ric may have some other
> > suggestions.
>
> Lorin,
>
> Why you say this is lexer fault?
> Java parser uses the same ANTLR lexer, yes?
>
> So why C++ parser is slower of Java ?!
>
> Sounds not pleasant.
>
>
> Oh guys: "I feel the need...the need for speed"
>
> -----------------------
> Terrence, Rick,
>
> Speed should be the highest priority for ANTLR 3.0 IMHO.
>
> You should develop
> -- regression tests
> -- regression BENCHMARKS
> -- run benchmarks with profiles
> improve everything you can improve.
>
>
>
> --
> 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