axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andreas Veithen (JIRA)" <>
Subject [jira] Commented: (AXIS2-4524) Caching BeanInfo in adb module's BeanUtil improves performance
Date Sat, 12 Mar 2011 10:23:59 GMT


Andreas Veithen commented on AXIS2-4524:

A WeakHashMap won't work here. The reason is explained in the Javadoc of WeakHashMap: "care
should be taken to ensure that value objects do not strongly refer to their own keys, either
directly or indirectly, since that will prevent the keys from being discarded." This will
be the case here. On the other hand, if one tries to avoid this value->key strong reference
(by using WeakReference somewhere), then the entries in the cache will be removed during every
run of the garbage collector.

As noted above, if there was a simple solution to this problem, then Sun would have implemented
BeanInfo caching already in the JRE.

> Caching BeanInfo in adb module's BeanUtil improves performance
> --------------------------------------------------------------
>                 Key: AXIS2-4524
>                 URL:
>             Project: Axis2
>          Issue Type: Improvement
>          Components: adb
>    Affects Versions: 1.5
>            Reporter: Valgeir Halldórsson
>         Attachments: BeanUtil.diff, axis2.diff
> I've detected that org.apache.axis2.databinding.utils.BeanUtil class can be improved
for performance. It seems that invoking Introspector.getBeanInfo(Class,  Class) takes a lot
of time. By caching java.beans.BeanInfo in this class it doubles up (at least) the performance,
especially when returning a big dataset. I changed this myself and saw a great deal of performance

This message is automatically generated by JIRA.
For more information on JIRA, see:

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

View raw message