Re: [xsl] Regarding XSL performance on AIX

Subject: Re: [xsl] Regarding XSL performance on AIX
From: Mike Brown <mike@xxxxxxxx>
Date: Fri, 17 May 2002 02:51:30 -0600 (MDT)
Anand Ganapathy wrote:
> When I do the transformation on WindowsNT it takes 20/25 seconds wheres 
> on AIX it takes 3/4 minutes. I just can figure out why? Does any one have 
> any idea why this happens? Please tell me how I can fine tune my XSL for 
> enhanced performance.

I see an awful lot of XPath expressions that start with "//". These are
notoriously wasteful, resulting in the entire document being searched for the
matching nodes. Have you investigated the use of xsl:key?

>    <xsl:call-template name = "forloop1" >
>       <xsl:with-param name = "j" select = "$j"/>
>       <xsl:with-param name = "count1" select = "$count1"/>
>    </xsl:call-template>

If you are implementing 'for' loops to increment counters, you're probably
needing to have procedural programming bad habits beaten out of you. :)

I didn't take a close look at your stylesheet, but it looks to me like you
looking at the entire document many times, trying to find the information that
you think you need, rather than recursively walking through the entire
document just once and building up your output as you go along.

You should try to employ careful selection of nodes to process with
xsl:apply-templates and xsl:for-each.

Here are a few tree viewer stylesheets that you may also be interested in 
perusing for ideas:
(in IE on Win32 only) res://msxml3.dll/defaultss.xsl or res://msxml.dll/defaultss.xsl

   - Mike
  mike j. brown                   |  xml/xslt:
  denver/boulder, colorado, usa   |  resume:

 XSL-List info and archive:

Current Thread