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

RE: Self-Recursive Templates that split, Performance

Subject: RE: Self-Recursive Templates that split, Performance tips?
From: David Rudel <fwqhgads@xxxxxxxxx>
Date: Wed, 12 Mar 2014 12:43:32 +0100
 RE: Self-Recursive Templates that split
I'm looking for any pointers on speeding up an algorithm that uses
self-recursion, but the self-recursion can spawn multiple new
instances.

For example, imagine that the template AMOEBA is meant to model an
amoeba walking around on a surface.

AMOEBA is called with two parameters: a location indicating where the
amoeba is and a map indicating the terrain:

<xsl:template name="AMOEBA">
<xsl:param name="location" as "xs:double+"/>
<xsl:param name="Terrain" as "map(*)"/>

And based on the location and terrain, the amoeba takes a new step,
calling itself with the new location and a new terrain map. NOTE: the
new terrain map is a slight modification of the old terrain map.

But sometimes the Amoeba needs to split into two amoeba, so in some
cases the AMOEBA template will actually need to call two separate
versions of itself (with different locations and terrains).

Any tips for how to accomplish this with as good performance as
possible, given that it is impossible for both calls to be in tail
position?
-David


-- 

"A false conclusion, once arrived at and widely accepted is not
dislodged easily, and the less it is understood, the more tenaciously
it is held." - Cantor's Law of Preservation of Ignorance.

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.