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

how to optimize recursive algorithm?

Subject: how to optimize recursive algorithm?
From: "FC" <flavio@xxxxxx>
Date: Thu, 27 Nov 2003 14:37:10 +0100
algorithm download
Houston, we've got a problem.
I have a transformation calculating the position of certain graphical
elements and each element's position is affected by the position of its
ancestors and preceding siblings. The recursive algorithm I wrote works
well, meaning that the result is correct but is painfully slow when dealing
with big documents.
This is no surprise because I am fully aware of the functional language
constraints, but I am wondering if there is no viable workaround.
For instance, I don't know the constraints imposed to the optimizer but I
would expect some sort of "caching" of values calculated previously when the
same node is processed over and over by the same piece of code.

For instance, say you have a source document like this:

<top>
    <a/>
    <b/>
    <c/>
    <d/>
</top>

and the output of "b" depends on the position of "a", "c" depends on "b" and
so on.
When the processor (recursively) processes "d", it should find, somewhere,
the value calculated for "c" previously and (magically) save time.

Now, since I really don't know what kind of optimizing mechanism is in place
for the xslt engines I've been using so far (Saxon, Altova, Microsoft), I am
asking if you have any idea as how to make recursive algorithms faster in
cases like those just described.

Bye,
Flavio


 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.