Rich,
If ConcurrentHashMap is a better solution, you can use the backport
version which works on Java 1.4 and Java5. See
org.apache.axis2.util.CallbackReceiver for an example.
Cheers,
David

On 15/11/2007, Rich Scheuerle (JIRA) <[EMAIL PROTECTED]> wrote:
> Performance: Synchronization of AbstractContext.addPropertyDifference 
> degrades performance
> ------------------------------------------------------------------------------------------
>
>                  Key: AXIS2-3344
>                  URL: https://issues.apache.org/jira/browse/AXIS2-3344
>              Project: Axis 2.0 (Axis2)
>           Issue Type: Bug
>             Reporter: Rich Scheuerle
>             Assignee: Rich Scheuerle
>
>
> Problem:
> David Strite, a member of the IBM performance analysis team, discovered that 
> the synchronization of AbstractContext.addPropertDifference has a performance 
> impact due to the high volume of callers of AbstractContext.getProperty and 
> AbstractContext.setProperty.
>
> Solution:
> The synchronization is changed so that it is limited to the case where a 
> ClusterManager is available.
>
> private void addPropertyDifference(String key) {
>         ConfigurationContext cc = getRootContext();
>         if (cc == null) {
>             return;
>         }
>         // Add the property differences only if Context replication is 
> enabled,
>         // and there are members in the cluster
>         ClusterManager clusterManager = 
> cc.getAxisConfiguration().getClusterManager();
>         if (clusterManager == null ||
>             clusterManager.getContextManager() == null) {
>             return;
>         }
>         // Narrowed the synchronization so that we only wait
>         // if a property difference is added.
>         synchronized(this) {
>             propertyDifferences.put(key, new PropertyDifference(key, false));
>         }
>     }
>
> Long Term Solution:
> We might want to consider using a ConcurrentHashMap (only available in JDK 
> 5+) or narrow the synchronization for the other methods.
>
> --
> This message is automatically generated by JIRA.
> -
> You can reply to this email to add a comment to the issue online.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


-- 
David Illsley - IBM Web Services Development

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to