axis-java-dev mailing list archives

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

    [ https://issues.apache.org/jira/browse/AXIS2-4524?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13006022#comment-13006022
] 

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: https://issues.apache.org/jira/browse/AXIS2-4524
>             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
improvement. 

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@axis.apache.org
For additional commands, e-mail: java-dev-help@axis.apache.org


Mime
View raw message