axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Michael Thome (JIRA)" <>
Subject [jira] Updated: (AXIS-1862) Significant performance problem with NodeImpl.getOwnerDocument
Date Wed, 09 Mar 2005 19:36:52 GMT
     [ ]

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:
>      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
> A proposed patch will follow.

This message is automatically generated by JIRA.
If you think it was sent incorrectly contact one of the administrators:
If you want more information on JIRA, or have a bug to report see:

View raw message