Subject: Re: [xsl] problem: recursive templates slowing xalan processor down From: Brian Chrisman <brian.chrisman@xxxxxx> Date: Tue, 11 May 2004 10:36:21 -0700 |
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:
Thanks, Brian
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] problem: recursive templa, Jeni Tennison | Thread | RE: [xsl] problem: recursive templa, Michael Kay |
Re: [xsl] What is the best approach, Julian Voelcker | Date | RE: [xsl] What is the best approach, M. David Peterson |
Month |