xsl-list
[Top] [All Lists]

Re: [xsl] Which executes faster: templates with specific match-patterns and simple content or templates with simple match-patterns and specific content ?

2014-11-04 15:24:36
It depends. Measure it and see, and tell us what you find.

For example, it depends on what XSLT processor you are using and it depends on 
what other template rules are present.

Michael Kay
Saxonica
mike(_at_)saxonica(_dot_)com
+44 (0) 118 946 5893




On 4 Nov 2014, at 20:32, Costello, Roger L. costello(_at_)mitre(_dot_)org 
<xsl-list-service(_at_)lists(_dot_)mulberrytech(_dot_)com> wrote:

Hi Folks,

Which executes faster:

<xsl:template match="A[@x eq 'a']/B[@y eq 'b']/C">
              <xsl:if test="D eq 10">...

or

<xsl:template match="A[@x eq 'a' ]">
              <xsl:if test="B[@y eq 'b']/C/D eq 10">...

That is, will my program execute faster if:

- I have templates with highly specific match-patterns and the templates 
contain a simple if-statement

or

- I have templates with a simple match-patterns and the templates contain a 
highly specific if-statement

/Roger

--~----------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
EasyUnsubscribe: http://lists.mulberrytech.com/unsub/xsl-list/1167547
or by email: xsl-list-unsub(_at_)lists(_dot_)mulberrytech(_dot_)com
--~--

<Prev in Thread] Current Thread [Next in Thread>