[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: Abel Braaksma <abel.online@xxxxxxxxx>
Date: Wed, 02 May 2007 22:36:38 +0200
Re:  How is memory allocated in recursive XSLT template
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.

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...)

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

-- Abel Braaksma

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-2011 All Rights Reserved.