Re: [xsl] Sorting using helper structure, position(), xsl:key

Subject: Re: [xsl] Sorting using helper structure, position(), xsl:key
From: Abel Braaksma <abel.online@xxxxxxxxx>
Date: Wed, 16 Apr 2008 17:31:56 +0200
Michael Ludwig wrote:

What I was referring to is the case of a large node-set, say, 300 nodes, which you have to repeatedly search, say, at each of 300 iterations. I've seen a significant speed-up using key('bla', @id) versus $bla[@id = current()/@id], which is, I think, one of the reasons why keys exist.

And also the reason I wrote "unfortunate" in the above quote.


I see what you mean. And yes, when comparing keys to using variables, then keys have the (big) advantage of (usually!, but don't try Altova, because then it may well slow down instead) faster execution time.


On a side note: some processors are known to do internal optimizations that are equal or even better then hand crafted key optimizations. I believe for XSLT 1.0 the .NET processor is one of those highly optimized ones, and for XSLT 2.0 I believe that Saxon starts to be increasingly more optimized with each new version.

Cheers,
-- Abel Braaksma

Current Thread