[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

RE: [xsl] Re: On XSLT 2.0 Writing Styles


Subject: RE: [xsl] Re: On XSLT 2.0 Writing Styles
From: "Michael Kay" <mhk@xxxxxxxxx>
Date: Sun, 12 Oct 2003 14:33:56 +0100

> I understand the answers to the following questions depend on 
> how the two stylesheets are written, but assuming they are 
> done "in a similar way", e.g. the f:foldl example Dimitre provided.
> 
> What about efficiency differences between the two approaches? 
>  Do you think it is likely that an XSLT processor will handle 
> and process a stylesheet in either syntax the same, or very 
> similar, way?  Will they "compile into the same internal 
> instructions"?  Will the processor be able to apply the same 
> internal optimizations? Or is it possible that an XSLT 
> processor will be able handle a stylesheet written in mostly 
> XPath (or XSLT) more efficiently?

At the moment Saxon generally executes XPath expressions using pipelined
iterators: a "pull" style that takes maximum advantage of lazy
evaluation. Saxon executes XSLT instructions using a completely
different "push" style, where the result of the expression is placed on
a result tree (or a result sequence) as soon as it is executed. So the
performance profiles are likely to be significantly different. However,
it's likely that in time there will be more cross-over between these two
approaches; there are already some cases where the XSLT instructions are
compiled into XPath expressions. In XQuery there is no difference
between instructions and expressions and I expect that the difference
will gradually disappear in Saxon's internals.

Basically I don't think there is any intrinsic reason why one style
should be more efficient than the other, but there may be differences in
a particular processor at a particular point in time.

Michael Kay


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list



Current Thread
Keywords