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

RE: [xsl] XSLT use cases; data-centric to document-centrictransformations


Subject: RE: [xsl] XSLT use cases; data-centric to document-centrictransformations
From: Peter Gerstbach <peter@xxxxxxxxxxxx>
Date: Tue, 8 Feb 2005 13:17:59 +0100

Zitat von Michael Kay <mike@xxxxxxxxxxxx>:

When comparing performance I found out, that xalan and saxon
perform bad when
there is only on big template. When the template is very large, saxon
even ends
up in an StackOverflowError.

I think you're drawing conclusions too hastily: "when" does not imply "because".

I'm sorry, this was not a wise generalisation.
I should have better said: With one special, very large template, saxon ends up
in a StackOverflow. And the performance is only about 50% slower. The template
I used for this comparison is indeed not very common (see below).


Saxon is unlikely to produce a StackOverflowError unless there is a very
deep (usually infinite) recursion in your code, which I would have thought
was more likely when you have many small templates than when you have one
large one.

Well in my case it is one single flat template, but very large. It contains
about 500 hundred fo:block elements, and in these elements there are sometimes
xsl:if and xsl:for-each statements. I operate on a small XML file that contains
some values which are copied to the result document. (I used the saxon standard
tree)


I admit, this example sounds weird and I should have explained it, when saying
something about processors & performance.
But my goal is to write a tool which creates stylesheets for very large fo
documents, so I just want to find out, at which size XSLT processors begin to
have problems.

What you are really saying is that you wrote a stylesheet that used a large
template and it performed badly on two processors. The chances are that the
inefficiencies in your code had nothing to do with the choice of XSLT
processor, and nothing to do with the fact that it was using a large
template. Rather, it was probably using an inefficient algorithm.

Yes, the inefficiencies can be found in my code indeed (knowingly). But I think
it's only natural, that processors perform better with well written stylesheets
than with stylesheets, containing only one very big template.


Regards,
Peter


Current Thread
Keywords