You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by "Rich Scheuerle (JIRA)" <ji...@apache.org> on 2007/11/15 13:25:43 UTC

[jira] Created: (AXIS2-3344) Performance: Synchronization of AbstractContext.addPropertyDifference degrades performance

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: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org


Re: [jira] Created: (AXIS2-3344) Performance: Synchronization of AbstractContext.addPropertyDifference degrades performance

Posted by David Illsley <da...@gmail.com>.
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) <ji...@apache.org> 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: axis-dev-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-dev-help@ws.apache.org
>
>


-- 
David Illsley - IBM Web Services Development

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


[jira] Resolved: (AXIS2-3344) Performance: Synchronization of AbstractContext.addPropertyDifference degrades performance

Posted by "Rich Scheuerle (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AXIS2-3344?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Rich Scheuerle resolved AXIS2-3344.
-----------------------------------

    Resolution: Fixed

Committed Revision 595293

> 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: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org