RE: [xsl] Performance Tuning

Subject: RE: [xsl] Performance Tuning
From: Bhupendra Singh <skbhupendra@xxxxxxxxxxx>
Date: Wed, 10 Nov 2004 22:22:29 +0000 (GMT)
Andrew,
Thanks for your suggestions but I could not gain
significant amount with your suggestions.
Its coming around the same with saxon parser.


 --- Andrew Welch <ajwelch@xxxxxxxxxxxxxxx> wrote: 
> 
> > > The XSL that I use has  three
> "preceding-sibling::"
> > > The time taken to parse a 150KB XML in Xalan is
> 1.9
> > > sec and with Saxon8 its 1.6 secs.
> > > 
> > > Since the above parsing is done frequently in my
> > > application with different input XMLs. I need to
> > > further reduce the transformation timing (in
> > > milliseconds may be). The only bottleneck I see
> are
> > > the 3 preceding-sibling. Can we somehow remove
> them
> > > or
> > > use some other logic, to reduce my
> transformation
> > > time.
> 
> Rather than walk the preceding-sibling axis many
> times, why not perform
> a single pass in a global variable and then key into
> that for the
> positions:
> 
> So, the top-level variable:
> 
> <xsl:variable name="parentGroup">
>   <xsl:for-each select="ParentGroup">
>     <parentgroup id="generate-id()"
> pos="position()"/>
>   </xsl:for-each>
> </xsl:variable>
> 
> And the key:
> 
> <xsl:key name="parentGroups" match="ParentGroup"
> use="@id"/>
> 
> Then, instead of using
> count(preceding-sibling::ParentGroup), use:
> 
> <xsl:value-of select="key('parentGroups',
> generate-id())/@pos"/>
> 
> Remember you will need to change the context node to
> $parentGroup before
> using the key.
> 
> If you do this, please post back any changes in
> performance.
> 
> cheers
> andrew
> 
>  


	
	
		
___________________________________________________________ 
ALL-NEW Yahoo! Messenger - all new features - even more fun! http://uk.messenger.yahoo.com

Current Thread