|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: improving performance in creating ids
> Thanks for your quick reply. the node identity comparison helped quite a bit, although I am still around a minute for a full book of ids. I am not sure how xsl:number would help here, and what kind of performance win it would give over count(). I tried something with a nested transformation, but what should I feed it? > > <xsl:number select="*[last()]"/> > works (given a set of preceding nodes) but it is slightly slower than a count() in the xquery. Maybe I should be using xsl:number differently? Saxon attempts to optimise xsl:number for the case where you are numbering many nodes: it will try to detect cases where the result is going to be the same as the previous execution plus 1. In fact in recent releases it is rewritten to use an internal accumulator. Another way you can achieve a similar effect "by hand" is with a memo function: if the ID for a node is computed as the ID of the previous node plus 1, and the function that does that is a memo function, then numbering N nodes will have performance increasing linearly with N. Michael Kay
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








