You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xalan.apache.org by bu...@apache.org on 2002/09/13 18:53:15 UTC
DO NOT REPLY [Bug 12624] New: -
Performance issues in variable assigment
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=12624>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND
INSERTED IN THE BUG DATABASE.
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=12624
Performance issues in variable assigment
Summary: Performance issues in variable assigment
Product: XalanJ2
Version: 2.4Dx
Platform: PC
OS/Version: Windows NT/2K
Status: NEW
Severity: Normal
Priority: Other
Component: org.apache.xalan
AssignedTo: xalan-dev@xml.apache.org
ReportedBy: johnglinux@eyecatching.com
I have this stylesheet that makes about 30 different database
queries and produces about 3000 lines of XSL code, which
in the end produces a 4-5 page tabular data form. For each cell I
have a template that allows you to format the cell data, an example
is:
<xsl:template match="col[@mode='simple"]>
<xsl:param name="data"/>
<xsl:variable name="colMap" select="./@colMap"/>
<xsl:variable name="val" select="$data/col[@column-label=$colMap]"/>
<fo:block>
<xsl:value-of select="$val"/>
</fo:block>
</xsl:template>
now if I replace that template with the following
<xsl:template match="col[@mode='simple]" >
<xsl:param name="data"/>
<xsl:variable name="colMap" select="./@colMap"/>
<fo:block>
<xsl:value-of select="$data/col[@column-label=$colMap]"/>
</fo:block>
</xsl:template>
the whole stylesheet is processed 2X faster, a difference from 4 sec
to 2.1 sec. I just ca't see why, there is just as many XPath statements
and they are just as complex. It is not the variable assignment because
the following template is only marginally slower.
<xsl:template match="col[@mode='simple]" >
<xsl:param name="data"/>
<xsl:variable name="colMap" select="./@colMap"/>
<xsl:variable name="val" select="$data"/>
<fo:block>
<xsl:value-of select="$data/col[@column-label=$colMap]"/>
</fo:block>
</xsl:template>