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

RE: problem: recursive templates slowing xalan process

Subject: RE: problem: recursive templates slowing xalan processor down
From: "Michael Kay" <mhk@xxxxxxxxx>
Date: Tue, 11 May 2004 20:04:17 +0100
xalan recursion
> I read in another post that tail recursion performs better because 
> internally some processors convert it from recursion to looping.  Are 
> there other reasons processors fare better with tail 
> recursion as well?
> 

When the last thing that a template does is to call another template (or
itself), then instead of making the call and then unwinding the stack, it is
possible to unwind the stack and then make the call. This is actually true
whether the call is recursive or not, but the benefits come with calls that
are deeply recursive. It isn't faster (the same two operations are
performed, but in the reverse order) but it avoids consuming stack space.
Generally most XSLT processors run out of stack space at a recursion depth
of 500 or so.

Michael Kay

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.