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

RE: How expensive is //?

Subject: RE: How expensive is //?
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Fri, 8 Sep 2006 23:58:48 +0100
RE:  How expensive is //?
> Is // (memory) equivalent to /Records/Record when there is 
> only one Records, and only one child Record?
> 

It depends entirely on your processor.

For Saxon: the first time you do //x on a given document (for a given x) it
searches the whole document looking for elements named x. In the majority of
cases, this will take longer than an explicit path expression such as
/a/b/c/x. However, the list of x elements that it finds is saved as a kind
of index, linked to the document node, so that the next time you do //x on
the same document it already knows the answer: which is therefore cheaper
than repeating the /a/b/c/x query. This also applies if the //x is part of a
longer path expression.

But you seem to be suggesting that your document is tiny, in which case none
of this makes any measurable difference. Do you actually have a performance
problem, and if so what is it?

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

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.