This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

RE: XSL sheet Optimisation


> 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]