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

Re: How is memory allocated in recursive XSLT template

Subject: Re: How is memory allocated in recursive XSLT templates?
From: "Rashmi Rubdi" <rashmi.sub@xxxxxxxxx>
Date: Wed, 2 May 2007 16:43:42 -0400
Re:  How is memory allocated in recursive XSLT template
On 5/2/07, Abel Braaksma <abel.online@xxxxxxxxx> wrote:
Rashmi Rubdi wrote:
>
>
> Thanks a lot for the solution, I will try your code and see if I can
> compare the limits with 2 programming languages, just for the sake of
> curiosity.

Here's some fulfilling of curiosity ;)

The limit I found on my system was f:fac(472), where f:fac(473) raised
"Too many nested function calls. May be due to infinite recursion". This
was inside Eclipse. Outside Eclipse, the top appeared at f:fac(632) and
-Xss###k did not help anything, which makes me believe that the maximum
recursive depth is enforced by Saxon somehow.

It could be the memory space available to hold the longest number is limited, and not particularly the recursive depth. Although I could be wrong, because I know little.


Trying the same with AltovaXML showed a top of f:fac(999), where f:fac(1000) raised an error. AltovaXML has an /xslstack option, but that only seems to work with lower values, I can't seem to force it higher (which makes me wonder why the stack option is there in the first place).

(which proofs nothing, except perhaps that neither uses tail recursion
on this factorial function. Perhaps I should try it with templates and
see if the same depths are found...)

But reading your post further perhaps indicates the recursive depth. I still haven't tried this with Java yet, but will be working on it shortly --- soon as I finish understanding how to use BigInteger.

The most interesting result however was the speed: in all situations it
was blazingly fast (compile/run in < 1 sec)

-- Abel Braaksma

I have to read up on how to note the time in XSLT 2.0, will use Google for that.


-Regards
Rashmi

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.