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

RE: performance of variables in a xpath expression

Subject: RE: performance of variables in a xpath expression
From: "Michael Kay" <mhk@xxxxxxxxx>
Date: Wed, 19 Mar 2003 23:48:44 -0000
xpathexpression performances
> im curious about how much slower it is to use a
> variable in a xpath expression. 

The answers to performance questions always depend on which XSLT
processor you are using: without that information, the question is
meaningless.

Even with that information, one would need to see the two stylesheets
you are comparing; and as an implementor I would find out the answer by
measuring both and giving you the figures - which you could do just as
easily yourself.

There are some circumstances in which using variables can greatly help
performance, there are also some circumstances in which they might slow
things down. In theory, given a perfect optimizer, it probably wouldn't
make any difference either way; but optimizers are not perfect. Using a
variable will often be taken as a hint to the processor that you want to
use the value more than once: the chances are that if you put a value in
a variable, the processor is more likely to allocate memory to it rather
than computing the value repeatedly. Allocating the memory may or may
not be cheaper than recomputing the value.

Michael Kay
Software AG
home: Michael.H.Kay@xxxxxxxxxxxx
work: Michael.Kay@xxxxxxxxxxxxxx 



 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.