RE: [xsl] re xsl:Key

Subject: RE: [xsl] re xsl:Key
From: "Michael Kay" <mhk@xxxxxxxxx>
Date: Fri, 21 Mar 2003 13:19:18 -0000
> Here are parts of stylesheets that I use: 
> withIndex :
> key declaration
> <xsl:key name="clef2" match="//reference" use="authors/p/@last">
> 
> <xsl:for-each select='key("clef2","zorro")'>
> 	<li><xsl:value-of select="title"/></li>
> </xsl:for-each>

If you are only using the index once, for this one expression, then the
cost of building the index is likely to outweigh the saving it gives you
in the execution time. I'm surprised that any of your runs should
perform better with the index than without it, if it is only used once.
> 
> 
> noIndex 
> <xsl:for-each select="//reference/authors/p[@last='zorro']">
> 	<li><xsl:value-of select=".../../title"/></li>
> </xsl:for-each>
> 
> Some of my results (execution Time)
> 
> 
>   
>                    withIndex               noIndex
> Xalan2.5             8780ms                 9108ms     
> Saxon6.5.2  tree     2800ms                 2900ms
>  "          tinytree 3021ms                 1757ms   !!!!
> 
> 
> Could you explain me  differences between tree and tinytree 
> implementation. 
> 
No. I would need much more information than you have provided.
Performance can depend on many apparently unrelated factors (including
the fluttering of the wings of a butterfly...)

Michael Kay



 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread