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

Re: XSL: For-Each Efficient or Not?

Subject: Re: XSL: For-Each Efficient or Not?
From: Wendell Piez <wapiez@xxxxxxxxxxxxxxxx>
Date: Mon, 01 Jul 2002 11:44:48 -0400
disable output escaping performance impact
What Kevin says about the performance impact of complex matches would also seem to provide another reason why an XPath like

m:apply[factorof[not(preceding-sibling::*)]]

will be better than

m:apply[child::*[position()=1 and name()='factorof']]

which tests (what amounts to) the same thing. The first expression does not have to look at every child of the m:apply to see whether it meets the condition, and doesn't need to evaluate all those functions.

Not knowing the innards of any processor, of course, I'm only speaking in principle.

Cheers,
Wendell

At 12:15 PM 7/1/2002, you wrote:
And the complexity of the template match expressions in the stylesheets.
Simple tests on name or nodetype can be efficient but matches that involve
predicates are generally harder for a processor to index. These can cause
some processors to use sequential searching for a templates (slow for large
numbers of templates). I have seen the performance of some stylesheets
completely cripled by use of complex matches, e.g.,

<xsl:template match="m:apply[child::*[position()=1 and name()='factorof']]">

So its very specific to a processor/stylesheet pair and complex tests are
better done in for-each/if blocks if performance is more important than
maintainability.


======================================================================
Wendell Piez                            mailto:wapiez@xxxxxxxxxxxxxxxx
Mulberry Technologies, Inc.                http://www.mulberrytech.com
17 West Jefferson Street                    Direct Phone: 301/315-9635
Suite 207                                          Phone: 301/315-9631
Rockville, MD  20850                                 Fax: 301/315-8285
----------------------------------------------------------------------
  Mulberry Technologies: A Consultancy Specializing in SGML and XML
======================================================================


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.