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

Re: Updated Benchmark Available

Subject: Re: Updated Benchmark Available
From: uche.ogbuji@xxxxxxxxxxxxxxx
Date: Thu, 19 Oct 2000 23:20:02 -0600
tail recursive sieve
> 
> > The project's stylesheet makes heavy use of a tail recursive template.
> 
> I presume you  mean fully tail-recursive -- it's explicitly using
> call-template to reinvoke itself, and doing no work thereafter. As you
> said, your Lisp pseudocode example is cheating a bit by explicitly calling
> (output) on the result of the recursion, so it isn't really tail-recursion;
> to make it qualify, you'd need to have the body of your pseudocode generate
> the output and have the recursion _only_ recurse.
> 
> I haven't thought about XSLT in these terms. The concept seems plausable;
> the trick is structuring the code to recognize and take advantage of it
> without incurring significant overhead in other cases. Might be possible to
> do that in a static optimizing pass before running the stylesheet. Hm.
> 
> How common is tail recursion in XSLT?

Ha, have you taken a look at the N-Queens and Sieve of Erastothenes 
stylesheets?

Bit in all seriouness, tail recursion in XSLT is quite common.  You'll be 
surprised how many tasks become quite recursive at an order that exceeds the 
tree depth of the source document.  This is especially common when we XSLT 
sorts get ambitious and decide to code text-processing tasks in XSLT.

This is why 4XSLT optimizes tail-recursion, as does Saxon, as Mike Kay pointed 
out.  It also makes solving those 10x10 N-Queens problems a bit easier without 
running out of stack, eh?


-- 
Uche Ogbuji                               Principal Consultant
uche.ogbuji@xxxxxxxxxxxxxxx               +1 303 583 9900 x 101
Fourthought, Inc.                         http://Fourthought.com 
4735 East Walnut St, Ste. C, Boulder, CO 80301-2537, USA
Software-engineering, knowledge-management, XML, CORBA, Linux, Python



 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.