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

RE: how to estimate speed of a transformation

Subject: RE: how to estimate speed of a transformation
From: "Michael Kay" <mhk@xxxxxxxxx>
Date: Fri, 12 Dec 2003 11:25:12 -0000
RE:  how to estimate speed of a transformation
> On the other hand, if a template contains a variable 
> definition that does depend on template's parameters,
> 
> <xsl:template name="footer">
>   <xsl:variable name="doctitle" select="/book/descendant::title[1]"/>
> 
> the programmer should expect that the computation takes place 
> only once. 

I suspect you meant to say "that *doesn't* depend on template's
parameters". But this variable *does* depend on the parameters, in the
sense that it depends on the context node (leading "/" selects the root
of the tree containing the context node) and the context node is an
implicit parameter to every template.

This is, however, a case where some simple caching might be appropriate.

I said in a previous response that Saxon doesn't do any caching. I just
realized another case where it does cache: for xsl:number. Saxon
remembers the last result of <xsl:number> and under the right
conditions, evaluates it by adding one to the previous result. This
makes the performance of numbering a sequence of n nodes O(n) rather
than O(n^2). But I would have to look in the source code to tell you
exactly what the preconditions for this optimization are.

Michael Kay


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


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.