RE: [xsl] XSL sheet Optimisation

Subject: RE: [xsl] XSL sheet Optimisation
From: "Michael Kay" <mhkay@xxxxxxxxxxxx>
Date: Tue, 24 Apr 2001 15:56:19 +0100
> Would it be better (faster) to create keys for all the
> sections and access
> the particular section with it's key:
> <xsl:apply-templates select="key('mykey', $id)"/>
> or would it be better to do something like:
> <xsl:apply-templates select="//*[@id=$id]"/>
>
You can only really find out by trying both and measuring them. But with
Saxon, the key() solution will normally be significantly faster, provided
that you are executing this code often enough to pay back the cost of
building the hash table.

I have heard of a case where switching to use of keys reduced the run time
from 7 hours to 4 minutes; but it all depends on the data.

Mike Kay
Software AG


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


Current Thread