[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: tail recursion optimization (was How efficient is

Subject: RE: tail recursion optimization (was How efficient is DVC?)
From: "Michael Kay" <mhk@xxxxxxxxx>
Date: Sun, 23 Mar 2003 23:44:17 -0000
tail recursion optimization on
> The problem that when the recursive template is a matching 
> template instead of a named template, it is hard for the 
> processor to recognize that the apply-templates at the end of 
> the template will result in the same template being applied. 
> For example, Robert's second example has this:
> 
>   <xsl:template match="group">
>     <xsl:copy>
>       <xsl:copy-of select="@*"/>
>       <xsl:copy-of select="./city"/>
>     </xsl:copy>
>     <xsl:apply-templates select="./group"/>
>   </xsl:template>
> 
> I don't know if any processors can optimize this. 

It's true that Saxon today only does tail-recursion optimization on a
self-recursive call-template instruction. In principle, however, any
call done as the last thing in a routine can be optimized in this way,
it doesn't have to be a self-recursive call. So it's quite possible in
principle to optimize this one even if you can't recognize it as being
self-recursive.

Michael Kay


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.