[jboss-user] [JBoss Microcontainer Development] - Benchmarking classloaders

Kabir Khan do-not-reply at jboss.com
Wed Jul 21 13:03:32 EDT 2010


Kabir Khan [http://community.jboss.org/people/kabir.khan%40jboss.com] replied to the discussion

"Benchmarking classloaders"

To view the discussion, visit: http://community.jboss.org/message/553790#553790

--------------------------------------------------------------
I have got some basic benchmarks working. Instead of using AS classes, I am now generating my own using Chiba's ClassFileWriter to have better control over what exists where. The classes are only generated if the target/generated-classes and target/generated-jars directories don't exist already. You tell it how many jars to create, how many packages per jar and how many classes per package. If you change these numbers, be sure to delete the target/generated-* directories. So, if 2 is selected for each of these it then creates the following jars:
 
interface0.jar:
org.jboss.test.interface0.pkg0.Interface0.class
org.jboss.test.interface0.pkg0.Interface1.class
org.jboss.test.interface0.pkg1.Interface0.class
org.jboss.test.interface0.pkg1.Interface1.class
 
 
interface1.jar:
org.jboss.test.interface1.pkg0.Interface0.class
org.jboss.test.interface1.pkg0.Interface1.class
org.jboss.test.interface1.pkg1.Interface0.class
org.jboss.test.interface1.pkg1.Interface1.class
 
 
abstract0.jar:
org.jboss.test.abstract0.pkg0.Abstract0.class
org.jboss.test.abstract0.pkg0.Abstract1.class
org.jboss.test.abstract0.pkg1.Abstract0.class
org.jboss.test.abstract0.pkg1.Abstract1.class
 
 
abstract1.jar:
org.jboss.test.abstract1.pkg0.Abstract0.class
org.jboss.test.abstract1.pkg0.Abstract1.class
org.jboss.test.abstract1.pkg1.Abstract0.class
org.jboss.test.abstract1.pkg1.Abstract1.class
 
 
impl0.jar:
org.jboss.test.impl0.pkg0.Impl0.class
org.jboss.test.impl0.pkg0.Impl1.class
org.jboss.test.impl0.pkg1.Impl0.class
org.jboss.test.impl0.pkg1.Impl1.class
 
 
impl1.jar:
org.jboss.test.impl1.pkg0.Impl0.class
org.jboss.test.impl1.pkg0.Impl1.class
org.jboss.test.impl1.pkg1.Impl0.class
org.jboss.test.impl1.pkg1.Impl1.class

 
An example of the expected inheritance hierarchies is:
 
class org.jboss.test.impl1.pkg1.Impl1 extends org.jboss.test.abstract1.pkg1.Abstract1{}
class org.jboss.test.abstract1.pkg1.Abstract1 implements org.jboss.test.interface1.pkg1.Interface1{}

 
 
I then create a classloader for each jar, with different classloading rules per test and try to load the Impl classes from the implx.jar loaders, which triggers searches for the superclasses/interfaces in the other classloaders. 
 
 
Ales, can you take a look at how I am setting up the VFSClassLoaderFactories? I do this in the TestCase classes. The thing I found strange was that for the Module test I had to specify the packages as a capability as well as the module, but I'm not that familiar with how this works so maybe that's how it should be.
 
 
Running this a few times on a set of 50 jars with 10 packages per jar and 10 classes per package, I get the following results.:
 

Import/Export packages:
Deploying the VFSClassLoaderFactories and creating the loaders: 1862ms 1693ms 1847ms 1725ms 1706ms
Loading the classes: 5008ms 4883ms 4744ms 4893ms 5012ms
 
 
Export/ImportAll:
Deploying the VFSClassLoaderFactories and creating the loaders: 1657ms 1627ms 1659ms 1720ms 1573ms
Loading the classes: 4858ms 4693ms 4796ms 4714ms 4899ms
 
 
Import/Export module:
Deploying the VFSClassLoaderFactories and creating the loaders: 1785ms 1736ms 1766ms 1819ms 1901ms
Loading the classes: 4992ms 5609ms 5510ms 4991ms 5626ms



--------------------------------------------------------------

Reply to this message by going to Community
[http://community.jboss.org/message/553790#553790]

Start a new discussion in JBoss Microcontainer Development at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2115]

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20100721/a5328d38/attachment-0001.html 


More information about the jboss-user mailing list