[jboss-user] [JBoss Microcontainer Development] - JBoss Reflect Performance Javassist vs Introspection

Kabir Khan do-not-reply at jboss.com
Tue Apr 20 14:50:39 EDT 2010


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

"JBoss Reflect Performance Javassist vs Introspection"

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

--------------------------------------------------------------
I've written an in-AS benchmark which I'll run tomorrow to gather some more information about overheads of creating ClassInfos, looking up methods etc. What I had time to look at so far shows the Javassist implementation to be ~50x slower at obtaining the ClassInfos that the reflect one.

In the meantime, looking into why the BeanMetaData classes don't appear in the statistics, I found this:

   protected TypeInfo get(String name, ClassLoader cl, Class<?> clazz) throws ClassNotFoundException
   {
      if (name == null)
         throw new IllegalArgumentException("Null name");
      if (cl == null)
         throw new IllegalArgumentException("Null classloader");
 
      try
      {
         CtClass ctClass = poolFactory.getPoolForLoader(cl).get(name);
         return get(ctClass, clazz, cl);
      }
      catch(NotFoundException nfe)
      {
         return delegateToIntrospectionImplementation(cl, name); //End up here for a lot of the bootstrap classes
      }
   }


The above code was written to handle gets for generated proxy classes which will not appear in a classpool. As we know, creating Exceptions is very expensive, and could be at least part of the reason why the javassist implementation. 

The problem seems to be that in the bootstrap DefaultClassPoolFactory is used until it gets replaced by the real one. Flavia, is there a way to get the real ClassPoolFactory to kick in earlier?
 

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

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

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/20100420/e6c4c2df/attachment.html 


More information about the jboss-user mailing list