xsl-list
[Top] [All Lists]

Re: [xsl] Tool that measures the performance of an XSLT program ata fine granularity?

2020-07-26 16:00:00
Thanks Michael. If there is no way to get the performance of the basic pieces 
of an XSLT program, then how does one determine what is causing an XSLT program 
to run slow? For example, I have a function f that calls functions A, B, and C. 
The SAXON profile tool says that the total execution time for A, B, and C is 1 
ms. The profile tool says that total time for f is 6 minutes. Without 
fine-grain profiling, I see no way to determine what is causing f to take so 
long to execute. Suggestions?

/Roger

From: Michael Kay mike(_at_)saxonica(_dot_)com 
<xsl-list-service(_at_)lists(_dot_)mulberrytech(_dot_)com> 
Sent: Sunday, July 26, 2020 4:19 PM
To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Subject: [EXT] Re: [xsl] Tool that measures the performance of an XSLT program 
ata fine granularity?

Short answer: no.

Even instrumenting the Java code internally is virtually impossible: the more 
you try to probe timings at fine granularity, the more you distort things like 
hot-spot optimization and CPU caching that have a profound effect on 
performance. Heisenberg comes to mind...

Remember also that execution of these constructs isn't going to be sequential. 
If the processor actually needs to do a run-time check that the results of 
random:sequence are all xs:doubles, then it's probably going to check each item 
as it's produced, rather than starting the checking when all the items in the 
sequence are available. There's also lazy evaluation to consider: there's a 
good chance that the processor will be evaluating the variable $hiddennodes as 
a "side-effect" of one of the two expressions that references it.

Michael Kay
Saxonica


On 26 Jul 2020, at 20:36, Dr. Roger L Costello 
mailto:costello(_at_)mitre(_dot_)org 
<mailto:xsl-list-service(_at_)lists(_dot_)mulberrytech(_dot_)com> wrote:

Hi Folks, 

Here is a statement in my XSLT program:

<xsl:variable name="who-list" select="random:sequence($hiddennodes * 
$outputnodes, 0.0, math:pow($hiddennodes, -0.5))" as="xs:double*" />

I would like to know the time required to execute each of these portions of 
that statement:

(1) math:pow($hiddennodes, -0.5)

(2) $hiddennodes * $outputnodes

(3) random:sequence($hiddennodes * $outputnodes, 0.0, math:pow($hiddennodes, 
-0.5))

(4) Time required to assign the variable the value

(5) Time required to ensure the value of the variable is a sequence of zero or 
more xs:double values

Is there a tool that provides such fine-grain performance measurements?

/Roger

http://www.mulberrytech.com/xsl/xsl-list 
http://lists.mulberrytech.com/unsub/xsl-list/673357 () 
--~----------------------------------------------------------------
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>