RE: [xsl] Performance with multiple users during transformation

Subject: RE: [xsl] Performance with multiple users during transformation
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Wed, 1 Dec 2004 16:44:39 -0000
> I have a 250 KB XML to be transformed into another XMl
> document. I am using a high end UNIX box with 8 CPUs
> and 32 Gig RAM. 
> Intially I was using Xalan and the timings for
> transformation are as follows:
> 1 user : 3 secs
> 2 users: 6 secs
> 4 users: 8 secs
> 
> Then I changed to Saxon8 and the timings are
> 1 user : 1.5 secs
> 2 users: 3 secs
> 4 users: 4 secs
> (I fear whats going to happen when 1000 users will use
> the applicaiton)

You need to explain your measurement scenario more carefully. How is the
XSLT processor running - as a servlet? How are you measuring response time?
What is the think time between transactions? Are these transformations all
using the same stylesheet? Are you saving the compiled stylesheet in memory?
Are they all running in the same thread, or do you have a pool of
threads/processes?
> 
> Although I got a 50% performance enhancement with
> Saxon for each scenario, but I still dont understand
> one thing why do we have the increase in
> transformation timing as the users increase.

That depends very much on how the work is being scheduled, which is why I
asked about your execution environment. 

> Since Saxon is based on SAX parsing there should be no
> memory constrained (Also my 32 Gig RAM is never
> utilised more than 5GB at any time.)

No, that's a bad misunderstanding. Every XSLT processor today builds the
source document in memory. However, 250Kb is not particularly big. Again,
however, it depends on how you are scheduling the work, how much memory you
are allocating to the Java VM, and so on. 
> 
> Can somebody briefly tell me how the transformation
> works, starting from how the XSL is parserd, how the
> XML is parsed and then the transformation.
> Can the parser and the XSLT processors be different.

If you're using Saxon, then the article at http://www.xml.com/pub/r/1065 may
be helpful.

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

Current Thread