[antlr-interest] Exception tests eat performance?

Terence Parr parrt at cs.usfca.edu
Wed Jan 7 22:20:26 PST 2004


On Wednesday, January 7, 2004, at 08:30  PM, Ney, Richard wrote:

> Hey Karl,
>
> If you are looking at performance issues one item you might look at is
> how often are you using the tree parser?
>
> The tree parser in the general nature of how it works (i.e. walking a
> linked list of tree nodes) is a major performance killer. This is due  
> to
> the problem of the next node not being in the CPU's data cache thus
> requiring a trip to main memory for the data.

Hi Richard,

I'm not sure you can compare a hand-built class of unknown structure to  
the regular tree parsers.  The algorithm is linear, but possibly with a  
large constant in front.  I doubt the CPU cache is the big issue,  
particularly if you do multiple walks...the entire tree might fit in a  
cache if it's small enough.

It is a good point to bring up thought that walking the entire tree  
with the parser is sometimes slower than you need it to be...irregular  
walking can be a big win as you say.

Ter

> In my component I was initially using the tree parser to do a lot of my
> runtime operations and was facing major performance issues. I changed  
> my
> application (which is in C#) to generate a runtime class to handle the
> operations with major performance improvements.
>
> Don't know if this helps you but I figured I'd mention it.
>
> -Richard
>
> ----------------------------------------------------------------------- 
> -
> ----
> Richard Ney                                     Aspect Communications
> Principal Software Engineer
>
> <http://www.aspect.com>                         Main:  408.325.2200
> <mailto:richard.ney at aspect.com>            	SJ Office: 408.325.2464
> Home Office: 916.797.9602
> ----------------------------------------------------------------------- 
> -
> ----
>
>
> The Three Laws of Infernal Dynamics:
> 1. An object in motion will always be headed in the wrong direction.
> 2. An object at rest will always be in the wrong place.
> 3. The energy required to change either of these states will always be
> more than you wish to expend, but never so much as to make the task
> appear prospectively impossible.
>
>
>
>
> -----Original Message-----
> From: Karl Meissner [mailto:meissnersd at yahoo.com]
> Sent: Wednesday, January 07, 2004 11:40 AM
> To: antlr-interest at yahoogroups.com
> Subject: Re: [antlr-interest] Exception tests eat performance?
>
>
>>> But fine, I used returned values in my rules all the time too.
>>> The traditional alternatives to a return value are
>>>
>>> 1) reference parameters
>>
>> They don't work for primitives in Java unfortunately.
>
> Of couse.
>
> ResultInfo would be a object.
>
> whew!
> did not mean to start a flame war.
>
> btw Terr,  I like antlr a lot.  Thanks.
> I am using it in product that is close to shipping.
> So I am starting to think about speedups.
>
> Good luck
>
> Karl
>
>
> __________________________________
> Do you Yahoo!?
> Yahoo! Hotjobs: Enter the "Signing Bonus" Sweepstakes
> http://hotjobs.sweepstakes.yahoo.com/signingbonus
>
>
>
> 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/
>
>
>
>
>
> 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/
>
>
>
--
Professor Comp. Sci., University of San Francisco
Creator, ANTLR Parser Generator, http://www.antlr.org
Co-founder, http://www.jguru.com
Co-founder, http://www.knowspam.net enjoy email again!
Co-founder, http://www.peerscope.com link sharing, pure-n-simple




 

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