You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tuscany.apache.org by "Raymond Feng (JIRA)" <de...@tuscany.apache.org> on 2009/10/28 19:11:59 UTC
[jira] Resolved: (TUSCANY-3348) PERF: handleCallback is not
optimized
[ https://issues.apache.org/jira/browse/TUSCANY-3348?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Raymond Feng resolved TUSCANY-3348.
-----------------------------------
Resolution: Fixed
An improved fix were checked in under:
http://svn.apache.org/viewvc?rev=830700&view=rev
http://svn.apache.org/viewvc?rev=830703&view=rev
The orginal path has a flaw for the JDKCallbackInvocationHandler.
I found out there is a performance issue in CallableReferenceImpl.resolve(). It always tries to get the CompositeActivator from the thread local. I add a test to the "else" to avoid that.
One more thing I found is that the JDKInvocationHandler and JDKCallbackInvocationHandler (sublcass) use the same handleCallback() at this moment. I think we can optimize that as the JDKCallbackHandler probably just has to set up the callbackID for the callback while the JDKInvocationHandler needs to receive the callbackID/callbackObject from the client. If my understanding is correct, then the JDKInvocationHandler can do the callbackEndpoint check first (as Hasan's fix did) and JDKCallbackInvocationHandler just set the callbackID.
> PERF: handleCallback is not optimized
> -------------------------------------
>
> Key: TUSCANY-3348
> URL: https://issues.apache.org/jira/browse/TUSCANY-3348
> Project: Tuscany
> Issue Type: Improvement
> Components: Java SCA Core Runtime
> Environment: All
> Reporter: Hasan Muhammad
> Assignee: Raymond Feng
> Fix For: Java-SCA-1.5.2, Java-SCA-2.0
>
>
> The following change in JDKInvocationHandler.handleCallback() improves performance when callback is not defined.
> From:
> -----------------------------------
> private void handleCallback(Message msg, RuntimeWire wire, Object currentConversationID)
> throws TargetResolutionException {
> ReferenceParameters parameters = msg.getFrom().getReferenceParameters();
> parameters.setCallbackID(getCallbackID());
> if (msg.getFrom() == null || msg.getFrom().getCallbackEndpoint() == null) {
> return;
> }
> parameters.setCallbackReference(msg.getFrom().getCallbackEndpoint());
> ------------------------------------
> To:
> ------------------------------------
> private void handleCallback(Message msg, RuntimeWire wire, Object currentConversationID)
> throws TargetResolutionException {
> if (msg.getFrom() == null || msg.getFrom().getCallbackEndpoint() == null) {
> return;
> }
> ReferenceParameters parameters = msg.getFrom().getReferenceParameters();
> parameters.setCallbackID(getCallbackID());
> parameters.setCallbackReference(msg.getFrom().getCallbackEndpoint());
> -------------------------------------
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.