RE: [xsl] measuring performance of XSLT stylesheet

Subject: RE: [xsl] measuring performance of XSLT stylesheet
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Mon, 16 Nov 2009 19:34:07 -0000
> > Any tips on improving performance will also be helpful.
> 
> To state the obvious, you should measure using the processor, 
> stylesheet, and data that you will be using in real life.  
> They will affect the outcome far more than will any 
> generalisations that we can give.

Tony has given the most important piece of advice without actually spelling
it out: concentrate on measuring and understanding the performance you are
getting, and the improvements will follow naturally. Never try to make
improvements until you have a measurement framework in place. Expect to
spend 90% of your effort on measuring performance and 10% on improving it.

Some tips on measurement:

(a) make sure you distinguish/discount Java VM warmup time, stylesheet
compilation time, document parsing/building time, transformation time, and
serialization time. Any or all of these components may be of importance to
you, but some of them can probably be discounted in production applications,
so you need to discount them in your measurements.

(b) if you're going to measure Saxon from the command line, use the -t and
-repeat options, as well as -TP for profiling.

(c) measure with different source document sizes and plot how performance
varies with document size. This tells you a lot about the performance
characteristics of your code. If the performance is quadratic, look for
expensive predicates and try to replace them with keys.

(d) use metrics that relate to your performance requirements, so you know
when to declare success.

Regards,

Michael Kay
http://www.saxonica.com/
http://twitter.com/michaelhkay 

Current Thread