Details
-
New Feature
-
Status: Open
-
Major
-
Resolution: Unresolved
-
CurrentCVS
-
None
-
None
Description
Have support for supporting profiling in testXSLT.
Profiling is the indication of how many times each element in the stylesheet was executed and how long it took.
Example usage:
bash-2.05b$ time ./testXSLT -in /tmp/v5.xml -out /tmp/t.xml -xsl /tmp/copy.xsl
real 0m22.116s
user 0m20.950s
sys 0m0.430s
bash-2.05b$
Now where do I spend my time? Beware profiling itself takes time.
bash-2.05b$ time bin/testXSLT -in /tmp/v5.xml -out /tmp/out.xml -xsl /tmp/copy.xsl -profile /tmp/profile.xml
real 1m18.900s
user 0m50.330s
sys 0m27.390s
bash-2.05b$ cat /tmp/profile.xml
<profile>
<profileData count="1" duration="0" line="-1" col="-1" uri="file:///tmp/copy.xsl" />
<profileData count="952510" duration="4580000" line="12" col="39" uri="file:///tmp/copy.xsl" />
<profileData count="476255" duration="7780000" line="13" col="38" uri="file:///tmp/copy.xsl" />
<profileData count="476255" duration="7270000" line="14" col="49" uri="file:///tmp/copy.xsl" />
<profileData count="1" duration="0" line="-1" col="-1" uri="file:///tmp/copy.xsl" />
<profileData count="832672" duration="5810000" line="18" col="28" uri="file:///tmp/copy.xsl" />
<profileData count="1439110" duration="8890000" line="24" col="28" uri="file:///tmp/copy.xsl" />
</profile>
bash-2.05b$ cat /tmp/copy.xsl
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:fn="http://www.w3.org/2005/xpath-functions" xmlns:xdt="http://www.w3.org/2005/xpath-datatypes">
<xsl:output method="xml" indent="yes"/>
<xsl:template match="*">
<xsl:element name="
">
<xsl:apply-templates select="@*"/>
<xsl:apply-templates select="child::node()"/>
</xsl:element>
</xsl:template>
<xsl:template match="text()">
<xsl:copy-of select="."/>
</xsl:template>
<xsl:template match="comment()">
<xsl:copy-of select="."/>
</xsl:template>
<xsl:template match="@*">
<xsl:copy-of select="."/>
</xsl:template>
</xsl:stylesheet>
bash-2.05b$
Code is attached