xsl-list
[Top] [All Lists]

Re: [xsl] bad programming for speedup?

2007-07-24 04:16:06
Abel,

ouch, this hurts my eyes ;) 

It hurts my eyes too but, IMHO, there is no such thing as a silly question
as the list has now received several well-informed responses, including
yours, that make for very interesting discussion (not that I am suggesting
that you were berating the question in any way whatsoever).

Anyway, since you proposed what looks like an excellent solution, I'd
like to ask

1.  If anything would be achieved anything performance-wise by
splitting that copy-of-union into two instructions, viz.,

        <xsl:copy-of select=". " />
        <xsl:copy-of select="following-sibling::row" />

and thereby saving the processor the potential overhead of
having to do doc-order comparison on nodes in calculating
the union.  Further in the general case of

        copy-of select="$a | $b | $c"

when one already knows that $a nodes precede $b nodes
which, in turn, precede $c nodes in document order, is it more
efficient to split these into individual copy operations, viz.

        copy-of select="$a "
        copy-of select="$b "
        copy-of select="$c"

2.  Apart the fact that xsl:copy-of has some additional special-purpose
attributes over and above xsl:sequence,  is there any discernable
difference between xsl:copy-of and xsl:sequence.  Accordingly, in your
solution having the following instead would have achieved exactly the
same result and with exactly the same performance?

        <xsl:sequence-of select=". | following-sibling::row" />

I'm suspecting that the answer to this question will be quite interesting
as well,
perhaps depending on whether one is serializing final output or writing a
sequence constuctor for an xsl:variable.

Cheers also

Justin Johansson
Australia


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--