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

Re: How is memory allocated in recursive XSLT template

Subject: Re: How is memory allocated in recursive XSLT templates?
From: "Rashmi Rubdi" <rashmi.sub@xxxxxxxxx>
Date: Thu, 3 May 2007 17:40:22 -0400
Re:  How is memory allocated in recursive XSLT template
On 5/3/07, Michael Kay <mike@xxxxxxxxxxxx> wrote:
>
> I think I would prefer an extension function within the XSLT
> itself rather than from the command line, because then I
> would be able to note the time immediately before and after
> the function in question.

If you're using Saxon, the best way of getting fine-grained instrumentation
is to use the TimerTraceListener, which can be activated using -TP from the
command line.

I tried the -TP option, it provides a lot more useful analysis information than I imagined. It is especially useful to see the timing analysis for each function call itself.

I tried

java -Xss16384k -jar c:\dev\saxonb8-9-0-3j\saxon8.jar -it mainTemplate
-TP recursion.xsl 2>profile.xml

java -jar c:\dev\saxonb8-9-0-3j\saxon8.jar profile.xml
timing-profile.xsl >profile.html

and saw a nice summary of the timing analysis in profile.html

In my case since I tried to calculate the factorial of 10450 , the
profile.xml was about 1MB, this of course is because of the huge
number of nested function calls. I  find the breakdown of each
functions time made possible by Saxons -TP option quite useful.

Then I lowered the parameter to factorial of 10, and observed that the
function calls are nested inside profile.xml , which makes is useful
to trace how they're called.

This writes a file containing timing information; there's a
stylesheet called analyze.xsl in the samples folder which allows you to
summarize this information and determine how much time was spent in each
template or function.

Java's timing information is not very precise; you will only get meaningful

Yes, I guess it varies because the garbage collection of objects happens at random.

To me it is not important to calculate the time precisely,
nevertheless it is useful to know the fact.

figures for a template or function that's executed several hundred times.

Details at
http://www.saxonica.com/documentation/using-xsl/performanceanalysis.html

I haven't fully explored Saxon, I meant to do my homework, but thank you for pointing this out.

Michael Kay
http://www.saxonica.com/

-Regards Rashmi

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.