JBoss classloaders vs. the default JVM classloader
sanderbos Aug 30, 2002 4:18 AMHi there,
[First off, my apologies for crossposting. I posted this same message in the performance tuning forum yesterday, but now I see it has been 10 days since anybody got an answer in that group. I hope nobody gets upset that I now try my luck here, since it is also a configuration issue.]
Does anybody know about the JBoss classloaders being significantly slower than the default JVM classloaders?
I am using JBoss 3.0.0, with Sun JDK 1.3.1 on both Linux and Windows 2000. I used Xerces 2.0.1 for my testcase, but I suspect the same problem occurs for any Xerces.
I've been hunting down a performance problem, and I have found it now. I made a reproducible test case for it. I attached that test-case, if you have ant it is reasonably easy to compile/ run.
What the test does is do 1000 client-server requests to parse a small file with Xerces (that I do not use jaxp is intentional, I want 'my' jars to be used for the parsing). I time how long this takes from the client perspective.
I ran the test with two configurations:
- Scenario 1: sample-bean jar in server/default/deploy, and the Xerces jars in server/default/lib. This is how I believe you are meant to deploy (I am kind of a newbie to EJB).
- Scenario 2: sample-bean jar in server/default deploy, and Xerces jars added to the JBoss classpath, like so:
set JBOSS_CLASSPATH=d:\cl\jars\xercesImpl.jar;d:\cl\jars\xmlParserAPIs.jar
and not in any JBoss directory.
Here are the times for the parsing of 1000 docs:
- Scenario 1: 36 seconds
- Scenario 2: 13 seconds...
I respect that the JBoss classloaders do some extra checks or something, but not that it becomes 3 times slower. Has anybody else experienced this? Is this what should be expected? Can something be configured to make it faster with the jars in the JBoss directory?
Most importantly for me is: What should we advise our customers (we have an EJB binding for our product, currently we advise people to configure it according to scenario 1....).
(It has nothing to do with Xerces. I just made a test-case with Xerces so you or somebody else may reproduce it, the problem was found when testing our own software)
Kind regards,
--Sander.
P.S.: The forum does not seem to like attachments, so you can now actually download it from
http://support.xhive.com/downloads/extras/testcase.zip