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 "Michael Thome (JIRA)" <ax...@ws.apache.org> on 2005/03/09 20:36:52 UTC

[jira] Updated: (AXIS-1862) Significant performance problem with NodeImpl.getOwnerDocument

     [ http://issues.apache.org/jira/browse/AXIS-1862?page=history ]

Michael Thome updated AXIS-1862:
--------------------------------

    Attachment: NodeImpl.patch

This patch dramatically improves performance in my index cases.  The time required to deserialize a reasonably small (1KB) but structurally-deep message dropped from 10 seconds (3/4 of the time spent in NodeImpl.getOwnerDocument and MessageElement.getOwnerDocument) to less than 2 seconds (*.getOwnerDocument < .1% of time).

The two issues with the original code are:
1. getOwnerDocument is both (a) called recursively on the parent and (b) the parent chain is iterated over within the method (this only has an effect when there isn't a document in parent chain).
2. when parent.getOwnerDocument returns a non-null value, it is re-invoked to return that value. (this only has an effect when there IS a document in the parent chain).

Note that there is a potential further optimization which may be available depending on the semantics required by axis (and Node): if these Nodes may never be "owned by" more than one document in their lifetimes, then a non-null document returned from a parent may be cached for later use.  It appears unlikely that this would make a significant difference in any real-world situation, so although I raise the possibility, I'd recommend leaving it out.

> Significant performance problem with NodeImpl.getOwnerDocument
> --------------------------------------------------------------
>
>          Key: AXIS-1862
>          URL: http://issues.apache.org/jira/browse/AXIS-1862
>      Project: Axis
>         Type: Bug
>   Components: Serialization/Deserialization
>     Versions: 1.2RC2, 1.2, 1.2RC3
>     Reporter: Michael Thome
>     Priority: Critical
>  Attachments: NodeImpl.patch
>
> The implementation of org.apache.axis.message.NodeImpl.getOwnerDocument uses an extremely poor algorithm: something like O(2^(n-1)) where n is the distance from one node to an ancestor node with an owner document.  This is a real killer for web services that pass deep structures around.
> A proposed patch will follow.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira