Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > XSLT
|
XSLT General questions and answers about XSLT. For issues strictly specific to the book XSLT 1.1 Programmers Reference, please post to that forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the XSLT section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old June 6th, 2007, 02:46 PM
jaybytez
Guest
 
Posts: n/a
Default Performance (xsl:element and file size)

We have a third party application that uses XSLTs extensively and the sizes of the template files can be pretty significant. We are trying to address issues such as the parser that is used, whether the XSLTs are cached, etc. In reference to the XSLT itself and the logic within it, I have two questions regarding performance:

In regards to xsl:element, is there a performance difference in the two statements because the first code segment happens all the time in the codebase instead of using shorthand to create the input element:

Code:
<xsl:element name="input">
<xsl:attribute name="type">hidden</xsl:attribute>
<xsl:attribute name="name">s_regionalLocationInd<xsl:value-of select="i_queueCodeID"/></xsl:attribute>
<xsl:attribute name="value"><xsl:value-of select="s_regionalLocationInd"/></xsl:attribute>
</xsl:element>
Code:
<input type="hidden" name="s_regionalLocationInd{i_queueCodeID}" value="{s_regionalLocationInd}"/>
Also, developers don't remove unused code and instead comment the code out using HTML comment tags. Also, there is a lot of indentation and whitespace that occurs because of pretty printing. Now if this was XML loaded into a DOM, all the comments and pretty printing would add significant size to the DOM representation in memory. Does this work the same with an XSLT parser? Even though HTML comments are not transferred to the output document, do they change the size of the XSLT object in memory? Would "unpretty printing" the XSLT in production help to lower the size of the XSLT in memory?

Thanks,

Jay

 
Old June 6th, 2007, 02:54 PM
mhkay's Avatar
Wrox Author
 
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

You can only ask this kind of question in relation to a specific XSLT processor. If you were asking about Saxon, I could tell you that none of these things would make any noticeable difference to run-time performance or memory usage or to the size of the compiled stylesheet. But that doesn't necessarily extrapolate to any other XSLT processor.

Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference





Similar Threads
Thread Thread Starter Forum Replies Last Post
performance issue with the xsl given here anboss XSLT 11 July 16th, 2008 03:05 AM
XSL(T) problems with xsl:element pan69 XSLT 3 December 13th, 2007 06:24 AM
xsl performance problem daula7 XSLT 1 May 25th, 2006 04:25 AM
xsl element identification vakorde XSLT 4 May 7th, 2006 04:48 AM
Sorting element in xsl Sakubar Sathik XSLT 5 April 6th, 2006 04:23 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.