xsl-list
[Top] [All Lists]

Re: [xsl] Here's how to benchmark your XSLT program's execution time

2014-11-06 09:16:00

Order of evaluation is undefined in XSLT, and there is no guarantee 
that $start is evaluated before the apply-templates call is evaluated.

Yikes!

So how do I write the XSLT program so that it is guaranteed that $start will 
be evaluated before the apply-templates call is evaluated?

There is no guaranteed-portable way of doing this. Doing an xsl:message that 
references $start before the apply-templates call would increase your chances; 
but there's still no guarantee that $start won't be evaluated much earlier, 
e.g. at compile time.

A safer way to get timing information with Saxon is to use a TraceListener. 
This is what the Saxon profiler (command line option -TP) does.

Michael Kay
Saxonica
--~----------------------------------------------------------------
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>