Re: [xslt] key() in match pattern of xsl:key



On Sun, 11 Dec 2005, Jirka Kosek wrote:

> Joel E. Denny wrote:
> 
> > I've never used Saxon myself.  I've read that libxslt is one of (or the)
> > fastest XSLT 1.0 processor around.  Maybe this is one of the reasons?
> 
> With the respect to Daniel and its work, my experience is that libxslt is very
> fast when XSLT code doesn't contain "complex computations". This is case for

Thanks for that information.

> Anyway if the performance is your main objective, you should benchmark several
> XSLT implementations and then choose your favorite implementation.
[snip]
> Back to your question, as keys are computed only once for the source document,
> there shouldn't be big performance penalty if you just remove key() from other
> keys' definitions.

To be clear, I'm not concerned with minor performance improvements for my 
current project. On the other hand, I did try replacing the referenced 
key() with an EXSLT user function.  Assuming a key is implemented as a 
hash, this changes the (one time) referencing key computation from O(n) to 
O(n^2).  That is, the EXSLT user function has to re-search the entire 
document upon every invocation whereas the referenced key() may be 
constant time. For large XML input, I'm not sure that's going to cut it 
with any XML processor.

Even so, I do plan to explore other implementations at some point to 
verify this.  Your information has provided more motivation.

Joel


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]