[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Recording start and end time of processing (in pi

Subject: Re: Recording start and end time of processing (in pipeline)
From: "G. Ken Holman" <gkholman@xxxxxxxxxxxxxxxxxxxx>
Date: Thu, 29 Apr 2010 12:57:25 -0700
Re:  Recording start and end time of processing (in  pi
At 2010-04-29 20:18 +0100, Fabre Lambeau wrote:
I have a quite complex XSLT sheet that processes some large amount data.
I'd like to record the start and end processing times in the output, so
that I can do rudimentary profiling of the work done.

The current time is a static property in the processing of the stylesheet. You will get the same value for every call during a single execution.


I've noticed however that in the following sort of scenario (pipeline
processing using variables to store intermediary steps), I end up
getting the exact same start and end times.

By definition: it is a static property.


<xsl:template name="process">
        <xsl:variable name="start" select="current-dateTime()"/>

        <xsl:variable name="step1">
                <!-- some processing -->
        </xsl:variable>

        <xsl:variable name="step2">
                <!-- some processing on step1 -->
        </xsl:variable>

<xsl:variable name="end" select="current-dateTime()"/>

        <xsl:result-document>
                <process start="{$start}" end="{$end}">
                        <xsl:sequence select="$step2"/>
                </process>
        </xsl:result-document>
</xsl:template>

I fully understand why (xsl processor evaluating only when necessary),
but wonder how I could get it working.

You cannot change the static nature of the call.


If you ran the following identity transform on your data and timed its execution from the command line:

  <xsl:template match="/">
    <xsl:copy-of select="."/>
  </xsl:template>

.... then you would have an approximate baseline for the time taken to invoke the processor, initialize the process, read the source tree and serialize the result tree.

Then run your timer on your stylesheet and subtract the baseline time to get an approximate time for your execution.

But as for timing portions of your execution ... that is not possible using standardized facilities. Check with your vendor.

I hope this helps.

. . . . . . . . . . Ken

--
XSLT/XQuery training:         San Carlos, California 2010-04-26/30
Principles of XSLT for XQuery Writers: San Francisco,CA 2010-05-03
XSLT/XQuery/UBL/Code List training: Trondheim,Norway 2010-06-02/11
Vote for your XML training:   http://www.CraneSoftwrights.com/m/i/
Crane Softwrights Ltd.          http://www.CraneSoftwrights.com/m/
G. Ken Holman                 mailto:gkholman@xxxxxxxxxxxxxxxxxxxx
Male Cancer Awareness Nov'07  http://www.CraneSoftwrights.com/m/bc
Legal business disclaimers:  http://www.CraneSoftwrights.com/legal

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.