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&...]