xsl-list
[Top] [All Lists]

RE: Comparing grouping techniques in terms of performance

2004-04-06 14:39:39
Hmmm, looking again at my <for-each> stylesheet, I found out that I got
repeated

<xsl:key name="contacts-by-surname" match="contact" use="surname" />

which made the transformation time so much bigger. 

Now it sort of equally transforms - it may even seem better.

Sorry for putting up this thread Michael - just forget it please.

I still would like to know if there are any sites that publish this type of
comparison - if not, I would be interested in setting up this myself as part
of my site.

<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

-----Original Message-----
From: Pieter Reint Siegers Kort 
[mailto:pieter(_dot_)siegers(_at_)elnorte(_dot_)com] 
Sent: Tuesday, April 06, 2004 4:14 PM
To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Subject: RE: [xsl] Comparing grouping techniques in terms of performance

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

--+------------------------------------------------------------------
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>
--+--