axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Hudson (Commented) (JIRA)" <>
Subject [jira] [Commented] (AXIS2-4878) Simple BeanInfo cache in helped us go from 48 second to 8 second request
Date Fri, 28 Oct 2011 22:24:33 GMT


Hudson commented on AXIS2-4878:

Integrated in Axis2 #1085 (See [])
    AXIS2-4524 / AXIS2-4878 / AXIS2-5118 / AXIS2-5119: Also implement BeanInfoCachingClassLoader
on JarFileClassLoader so that the cache works in all deployment scenarios.

veithen : 
Files : 
* /axis/axis2/java/core/trunk/modules/kernel/src/org/apache/axis2/classloader/

> Simple BeanInfo cache in helped us go from 48 second to 8 second request
> --------------------------------------------------------------------------------------
>                 Key: AXIS2-4878
>                 URL:
>             Project: Axis2
>          Issue Type: Improvement
>          Components: adb
>    Affects Versions: 1.5.2
>         Environment: Linux (Debian Lenny x86_64), JDK 1.6.0, Tomcat 6 (in NetBeans 6.5.1).
 Deployed POJO service as .aar file.
>            Reporter: Dan Armstrong
>            Assignee: Andreas Veithen
>             Fix For: 1.6.2, 1.7.0
>   Original Estimate: 0.25h
>  Remaining Estimate: 0.25h
> We return arrays of complex objects - all of the same type for any particular web services
call.  Axis2 was unusably slow.  Upon closer inspection, it was spending much of its time
in BeanUtil.  The #1 problem is that it is performing introspection repeatedly for each and
every object.  Introspection is very expensive - calling the methods once you find them is
> The solution is to perform the introspection and cache the results.  I added a few lines
of code to and brought our request from 48 seconds down to 8.  This solution
may not be exactly how you would implement it, but the idea is sound and the results are very
> import java.util.concurrent.*;
>     private static final ConcurrentMap<Class<?>,BeanInfo> beanInfoCache =
new ConcurrentHashMap<Class<?>,BeanInfo>();
>             // About line 140, where calls Introspector.getBeanInfo:
>             BeanInfo beanInfo = beanInfoCache.get(beanClass);
>             if(beanInfo==null) beanInfoCache.put(beanClass, beanInfo = Introspector.getBeanInfo(beanClass,
> The map would probably need to use weak references to not prevent class unloading.  And
you may not want to depend on the Java 5 generics and concurrent collections.  But the point
remains - without this POJO is too slow (rhyme intended).
> Please add this to the Axis2 to benefit others.
> Thank you,
> Dan Armstrong
> AO Industries, Inc.

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:!default.jspa
For more information on JIRA, see:


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message