Re: [xsl] how to estimate speed of a transformation

Subject: Re: [xsl] how to estimate speed of a transformation
From: David Tolpin <dvd@xxxxxxxxxxxxxx>
Date: Wed, 10 Dec 2003 17:35:13 +0400 (AMT)
Hi,

I would like to be able to estimate speed of a transformation through analysis
of the stylesheet, not through testing. I understand that immutability of data
in XSLT makes it possible to apply certain optimizations and compute recurrent
expressions faster due to memoization of previously computed results.

What are the optimization templates? Can one, looking at a template, say that
this template will be O(n log n) by the length of data in jd.xslt, linear in saxon
and O(n^2) in xsltproc?

For example, does access by position  takes time proportional to the position (list)
or does it require constant time (array)?

What operations  are memory-consuming in XSLT?  Is it possible to say that a given
operation allocates new space each time it is applied? If a nodeset is passed as a
parameter, does it allocate new space proportional to the size of the nodeset?

Are there guidelines that facilitate creation of stylesheets which, while benefit
from optimizations in advanced processors, do not exhibit steep time curves with
'naive' ones? That is, I am happy to see my program running fast with my 'right'
choice, but the stylesheet is in XSLT, not in SAXON XSLT, or MSXSL XSLT; it will
be run by people with a wide range of tools. 

For example, one can easily right a simple transformation which, with almost unnoticable
modifications and identical result, runs either in linear time with xsltproc, jd.xslt, xt and saxon;
or exhibits O(n log n) with jd.xslt , O(n ^ 2) with xsltproc and O(n) with saxon. At the same
time, it either runs in constant space with all of the processors, or in constant space with xt and jd.xslt,
but in linear space with saxon and more than linear with xsltproc.

How can I ensure that differences between processors cause linear changes in speed? How
can I predict space consumtion?

David Tolpin



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


Current Thread