xsl-list
[Top] [All Lists]

Re: [xsl] How to output the start execution time and the end execution time?

2014-09-06 12:47:39
Hi Wolfgang,

See my latest reply in this thread, about using accumulators, which gets rid of 
the issues related to order of execution. Also, in Dimitre's mail, at the 
bottom, he noted that you cannot be sure of what you are measuring, because of 
the undefined order of (parallelized?) execution.

Alternatively, I think you might be able to rewrite Dimitre's example using 
xsl:next-match, to force a proper order of execution. Something like this (not 
tested):

<xsl:template match="/" priority="10">
    <!-- get time, this is start time-->
    <xsl:next-match />
</xsl:template>

<xsl:template match="/" priority="9">
    <!-- "normal" processing -->
    <xsl:apply-templates />
    <xsl:next-match />
</xsl:template>

<xsl:template match="/" priority="8">
    <!-- get time, this is end time -->
</xsl:template>

But I am not 100% sure it will get rid of all possible optimizations. I.e., 
when the processor sees the fn:doc calls, it might try to pre-process them 
while at the same time already doing template processing. I don't think any 
processor optimizes so strongly, but that may be just a matter of time.

Cheers,

Abel Braaksma
http://exselt.net

From: Wolfgang Laun wolfgang(_dot_)laun(_at_)gmail(_dot_)com 
Sent: Saturday, September 06, 2014 7:10 PM

given that the call to an external timepiece delivers the 
wallclock time: how can one be sure that a call near the 
top of the  XSLT program is executed first, e.g., before 
. accessing the main document? And how can one be sure that 
a call near the end of the program is the last thing the 
program does, e.g., even after writing/serializing everything
and flushing all buffers?

Not really knowing what one measures? Not being sure how the 
data influences the result?
--~----------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
EasyUnsubscribe: http://lists.mulberrytech.com/unsub/xsl-list/1167547
or by email: xsl-list-unsub(_at_)lists(_dot_)mulberrytech(_dot_)com
--~--

<Prev in Thread] Current Thread [Next in Thread>