This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
RE: XSL: For-Each Efficient or Not?
- From: "Schrooten, Ben" <bschrooten at tjctechnology dot com>
- To: "'xsl-list at lists dot mulberrytech dot com'" <xsl-list at lists dot mulberrytech dot com>
- Date: Mon, 1 Jul 2002 12:02:53 -0400
- Subject: RE: [xsl] XSL: For-Each Efficient or Not?
- Reply-to: xsl-list at lists dot mulberrytech dot com
Thank you for your replies. With our XML documents being heavily static and
predictable i just needed some verification that the idea of xsl:for-each
causing a performance hit was not the case.
Best Regards,
Ben Schrooten
-----Original Message-----
From: Wendell Piez [mailto:wapiez@mulberrytech.com]
Sent: Monday, July 01, 2002 11:45 AM
To: xsl-list@lists.mulberrytech.com
Subject: Re: [xsl] XSL: For-Each Efficient or Not?
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@mulberrytech.com
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
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list