|
[XSL-LIST Mailing List Archive Home]
[By Thread]
[By Date]
[Recent Entries]
[Reply To This Message]
Re: problem: recursive templates slowing xalan process
Subject: Re: problem: recursive templates slowing xalan processor down
From: Brian Chrisman <brian.chrisman@xxxxxx>
Date: Tue, 11 May 2004 10:36:21 -0700
|
Jeni Tennison wrote:
Finally, and this is the most important rewrite, it's much better to
write a recursive template as a tail-recursive template if you can (or
as a divide-and-conquer template if there are hundreds of recursions
involved each time the template is called). A tail-recursive template
calls itself as the very last thing that it does. You need to have an
extra parameter to keep track of the current sum, and update this
parameter on each recursion. Here's what your template looks like when
it's rewritten using the advice above and as a tail-recursive
template:
I read in another post that tail recursion performs better because
internally some processors convert it from recursion to looping. Are
there other reasons processors fare better with tail recursion as well?
Thanks,
Brian
|
PURCHASE STYLUS STUDIO ONLINE TODAY!
Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!
Download The World's Best XML IDE!
Accelerate XML development with our award-winning XML IDE - Download a free trial today!
Subscribe in XML format
| RSS 2.0 |
|
| Atom 0.3 |
|
|