[XSL-LIST Mailing List Archive Home]
[By Thread]
[By Date]
[xsl] Here's how to benchmark your XSLT program's execution time
Subject: [xsl] Here's how to benchmark your XSLT program's execution time From: "Costello, Roger L. costello@xxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx> Date: Thu, 6 Nov 2014 10:20:23 -0000 |
Hi Folks, So, you've got an XSLT program that is taking a long time to execute. You want to find out what part of the program is taking so much time. You need to insert some start/stop timers into your XSLT. Here's how to do it: <?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:date="java:java.util.Date" version="2.0"> <xsl:output method="text" /> <xsl:output name="text-format" method="text"/> <xsl:template match="/"> <!-- Start a timer --> <xsl:variable name="start" select="date:getTime(date:new())" /> <!-- Do your XSLT processing --> <xsl:apply-templates /> <!-- End the timer --> <xsl:variable name="end" select="date:getTime(date:new())" /> <!-- Log the benchmarking results to a file, time-info.txt --> <xsl:result-document href="time-info.txt" format="text-format"> start: <xsl:value-of select="$start" /> end: <xsl:value-of select="$end" /> diff: <xsl:value-of select="$end - $start" /> </xsl:result-document> </xsl:template> <xsl:template match="*"> <!-- Do something --> <xsl:text>Hello World </xsl:text> <xsl:value-of select="current-dateTime()" /> </xsl:template> </xsl:stylesheet>
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] How to get XSL style shee, Martin Honnen martin | Thread | Re: [xsl] Here's how to benchmark y, Michael Kay mike@xxx |
Re: [xsl] Have a node that appears , Hank Ratzesberger xm | Date | Re: [xsl] Here's how to benchmark y, Eliot Kimber ekimber |
Month |
Keywords