At 09:18 PM 7/16/2002 -0600, Bryan Kearney wrote:
I am bumping my thread in the hopes that some people may not have seen it before, or that others may have come across some new ideas.
Also, for informational purposes, the time that I am actually measuring is the actual time that the transform call takes. In both cases, the Source is a StreamSource that has a ByteArrayInputStream at its base, and the Result is a StreamResult that is going to a ByteArrayOutputStream.
Can anyone think of anything, either java related, Tomcat related, xalan related, etc. that would cause the time for the same transform to be much much slower from within a servlet running in Tomcat as opposed to a test program run from command line.
Thanks in advance,
Mario-
1) Make sure you have 1 and only 1 xalan.
Tomcat 3.3.x has a custom classloader hierarchy that alleviates certain problems from earlier versions regarding class conflicts.
However, to be safe, I did remove the xalan jar in tomcat/lib/container and I removed their crimson.jar and replaced it with xerces.jar and xml-apis.jar.
4) Made use of the select attribute of <xsl:variable> instead of a nested <xsl:value-of>. This was well documented, and saved me a clone each time I looked up global variables. Since I was using them as global strings and numbers, this was a good gain.
This is something I will look at in the future. However, in my current case, the same stylesheets are being used for both my test program and my servlet.
5) Set the following system properties:
"org.apache.xml.dtm.DTMManager","org.apache.xml.dtm.ref.DTMManagerDefault" "org.apache.xerces.xni.parser.XMLParserConfiguration","org.apache.xerces.par sers.StandardParserConfiguration"
I set both of these system properties.
Thanks for the ideas, but unfortunately after making these changes and trying it out, my performance woes are still present.
I am more convinced that this has to do with the CPU usage. When I run my test program, it uses almost all of the CPU for the entire run, and consequently things get done quickly.
When run from within the servlet, the CPU varies from around 3% to about 30-45%, and only rarely spikes above that.
Does anyone know what would cause this, or a way to tell it to go ahead and chew the CPU so as to get done with processing as fast as possible?
As for the heap size issue, I tried setting it to -Xms128m and -Xmx128m and ended up blowing the heap under both my test program and tomcat. I don't really think it is a heap issue because this performance is similar on other machines we have tested on that have 1GB of memory.
Any further ideas or thoughts would be greatly appreciated.
Thanks,
Mario-
