RE: [xsl] Comparing grouping techniques in terms of performance

Subject: RE: [xsl] Comparing grouping techniques in terms of performance
From: Pieter Reint Siegers Kort <pieter.siegers@xxxxxxxxxxx>
Date: Tue, 6 Apr 2004 16:13:52 -0500
Hi Michael,

Thanx for your reply.

>You seem to have varied several things between the two stylesheets. One of
them uses for-each, another uses apply-templates; one uses the generate-id()
approach to compare node identity, the other uses the count($X|.) technique;
one adds more output; one does sorting. 

That's not what I want to compare here, although you have a point; for me as
a programmer, the output is what I need, and I need it the most efficient
(read: fastest) way, because I'm going to be working with big XML files. The
XSL processor should be able to sort out that part of the job: optimizing
the XSLT, just like database engines do.

>The golden rule with performance comparisons is to only change one variable
at a time. 

Of course. But this email is not intended as a 100% solid comparison test.
But it is solid enough to prove my point, I think. But, if I would, as you
say, equalize more the stylesheets to get the same output, then I at least
should add some HTML to the (already) slower <for-each> approach, which
would make it even slower.

In general, fact is that the input XML is the same; the XSL could be
modified to include the HTML so that the output is the same. Then I have met
the golden rule, as far as a programmer would consider. In my test, the
output were not similar but they were close enough to make my point clear
(at least that's what I hoped for).

>And then you need to repeat the measurements with a different XSLT
processor to see whether the results are similar.

Of course, I did not intent this comparison to be valid for all processors,
that's why I said that I only compared to MSXML 4.0, using XSelerator 2.6,
on Win2003. That should be enough entry to reproduce the results, although
only a approximate and relatively equal result may be obtained on another
machine. 

But I would like to extend this test on another processor - I could use
yours for example... did you do any tests on this kind of subject, Michael
(comparing stylesheets in terms of performance)? Is XSLT 2.0 doing better
with regards on these kind of tests?

<prs/>
http://www.pietsieg.com
http://www.pietsieg.com/dotnetnuke
Contributor on www.ASPToday.com
Co-author on "Professional ASP.NET XML with C#", July 2002 by Wrox Press

Current Thread