You are viewing a plain text version of this content. The canonical link for it is here.
Posted to kandula-dev@ws.apache.org by Kasun Gajasinghe <ka...@gmail.com> on 2010/08/03 08:44:13 UTC

Re: Improving Axis2/Rampart performance.

Hello,
This is regarding the final results (1st-phase) of Axis2/Axiom/Rampart
performance improvement. We wrapped up the improvements done so far, and ran
final test runs to compare the running times of Axis2 compared to CXF. There
are further improvements that can be done. We are aware about some of them,
so hopefully if it needs any further improvements, that can be done.

Basically, now we are trying to bring Rampart2 forward by replacing current
Rampart1. We need to complete it and there are some legal things to be
carried out as the coding happened outside the Apache Version Control (It
was a final year project done by four students at University of Moratuwa
namely, Sameera, Isuru, Saliya and Kalani).
In Rampart2, there is Rampart xml-security which is built on OM model. If we
use it, then there is no need of DOOM (the axiom-dom module). Hopefully,
this should improve performance considerably, as DOOM was the main culprit
in slowing down Axis2 as of now.

And, with these improvements, we are glad to say that Axis2 is now more than
30% faster than CXF for small samples as of the latest test result shows
:) This still need to be confirmed though! Overall, DOOM is now much
improved and is very closer to CXF in other usecases, in performance-wise.

 [0], [1] contains the final result charts, comparing Axis2 trunk version
vs. Axis2 with Improvements vs. CXF. We were mainly focused on improving
Sign & Encrypt (signencr) usecase for large samples, because improving it
will improve other scenarios as well, as it involves all the scenarios and
handlers (signing, encryption, tree building etc.)

We have submitted the Patch for Axiom module at WS-Commons Jira [2]. Patch
for Rampart to be uploaded soon.

[0] http://imagebin.ca/view/NzqFZNAR.html
[1] http://imagebin.ca/view/0NDzdKp.html

[2] https://issues.apache.org/jira/browse/WSCOMMONS-556


Thank you!
--KasunBG

~~~*******'''''''''''''*******~~~
Kasun Gajasinghe,
University of Moratuwa,
Sri Lanka.
Blog: http://kasunbg.blogspot.com
Twitter: http://twitter.com/kasunbg


On Tue, Jul 13, 2010 at 2:29 PM, Kasun Gajasinghe <ka...@gmail.com> wrote:

> Hello Devs,
> One more iteration on Axis2 and CXF Profiles revealed an interesting point.
> This is in the call tree, in the point which
> "org.apache.xml.security.c14n.implementations.CanonicalizerBase"
> class' canonicalizeSubTree() method calls to DOOM methods.
> In that method, handleAttributesSubtree() calls DOOM's
> ElementImpl.getAttributes() method. The Time spent on getAttributes()
> has amounted to around 10% of total cpu time. When, I looked at the time
> taken by the same method of CXF, it only used less than 1% of cpu time. So,
> clearly there's something wrong in here.
>
> I attached a screen shot to have a look at.
> i went through the source of Axis2 and CXF. I pasted the method so, all of
> you can have look. Please analyze them and suggest what we can do to remove
> this overhead.
>
> Thanks & Regards,
> --KasunBG
>
> =========================================================================
> CXF:
> /**
>      * Retrieve all the Attributes as a set. Note that this API is
> inherited
>      * from Node rather than specified on Element; in fact only Elements
> will
>      * ever have Attributes, but they want to allow folks to "blindly"
> operate
>      * on the tree as a set of Nodes.
>      */
>     public NamedNodeMap getAttributes() {
>
>         if (needsSyncData()) {
>             synchronizeData();
>         }
>         if (attributes == null) {
>             attributes = new AttributeMap(this, null);
>         }
>         return attributes;
>
>     } // getAttributes():NamedNodeMap
>
>
> =========================================================================
> Axis2:
>  /** Returns the set of attributes of this node and the namespace
> declarations available. */
>     public NamedNodeMap getAttributes() {
>         AttributeMap attributeMap = new AttributeMap(this);
>
>         // Add the set of existing attrs
>         for (int i = 0; i < this.attributes.getLength(); i++) {
>             attributeMap.addItem((Attr) this.attributes.getItem(i));
>         }
>
>         // Add the NS declarations
>         if (this.namespaces != null) {
>             Iterator nsDecls = this.namespaces.keySet().iterator();
>             while (nsDecls.hasNext()) {
>                 String prefix = (String) nsDecls.next();
>                 if (prefix != null && !"".equals(prefix)
>                         && !prefix.equals(OMConstants.XMLNS_NS_PREFIX)) {
>                     OMNamespace ns = (OMNamespace)
> this.namespaces.get(prefix);
>                     AttrImpl attr = new AttrImpl(this.ownerNode, prefix, ns
>                             .getNamespaceURI(), this.factory);
>                     attr.setOMNamespace(new NamespaceImpl(
>                             OMConstants.XMLNS_NS_URI,
>                             OMConstants.XMLNS_NS_PREFIX));
>                     attributeMap.addItem(attr);
>                 }
>             }
>
>             // Set the default NS attr if any
>             if (this.namespace != null
>                     && (this.namespace.getPrefix() == null || ""
>                     .equals(this.namespace.getPrefix()))
>                     && this.namespace.getNamespaceURI() != null) {
>
>                 // check if the parent of this element has the same
> namespace
>                 // as the default and if NOT add the attr
>                 boolean parentHasSameDefaultNS = this.parentNode != null &&
>                         this.parentNode.getNamespaceURI() != null &&
>
>  this.parentNode.getNamespaceURI().equals(this.getNamespaceURI()) &&
>                         (this.parentNode.getPrefix() == null ||
>                                 this.parentNode.getPrefix().equals(""));
>
>                 if (!parentHasSameDefaultNS) {
>                     AttrImpl attr = new AttrImpl(this.ownerNode, "xmlns",
>
> this.namespace.getNamespaceURI(), this.factory);
>                     attr.setOMNamespace(new NamespaceImpl(
>                             OMConstants.XMLNS_NS_URI,
>                             OMConstants.XMLNS_NS_PREFIX));
>                     attributeMap.addItem(attr);
>                 }
>             }
>         }
>
>         return attributeMap;
>     }
>
> =========================================================================
>
> ~~~*******'''''''''''''*******~~~
> Kasun Gajasinghe,
> University of Moratuwa,
> Sri Lanka.
> Blog: http://kasunbg.blogspot.com
> Twitter: http://twitter.com/kasunbg
>
>
> On Mon, Jul 12, 2010 at 9:25 PM, Kishanthan Thangarajah <
> kshanth2101@gmail.com> wrote:
>
>> On Mon, Jul 12, 2010 at 8:58 PM, Samisa Abeysinghe
>> <sa...@gmail.com> wrote:
>> > Can you guys provide patches for these improvements?
>>
>> Ok, we will do.
>>
>> Thanks,
>> Kishanthan.
>> >
>> > Thanks,
>> > Samisa...
>> >
>> > On Mon, Jul 12, 2010 at 12:16 PM, Kishanthan Thangarajah
>> > <ks...@gmail.com> wrote:
>> >>
>> >> Hi All,
>> >>
>> >> We also did some changes in DOMUtil class. We combined the getName and
>> >> getPrefix methods to one method. Because there were quite large calls
>> >> to these methods which took quite large time. So by combining these
>> >> methods to one and reducing the number of calls to the method, we were
>> >> able to get some improvements in time values.
>> >>
>> >> Thanks,
>> >> --
>> >> Kishanthan.T
>> >> University of Moratuwa.
>> >> SriLanka.
>> >>
>> >> ---------------------------------------------------------------------
>> >> To unsubscribe, e-mail: java-dev-unsubscribe@axis.apache.org
>> >> For additional commands, e-mail: java-dev-help@axis.apache.org
>> >>
>> > Thanks,
>> > Samisa...
>> >
>> > Samisa Abeysinghe
>> > VP Engineering
>> > WSO2 Inc.
>> > http://wso2.com
>> > http://wso2.org
>> >
>>
>>
>>
>> --
>> Kishanthan.T
>> University of Moratuwa.
>> SriLanka.
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: java-dev-unsubscribe@axis.apache.org
>> For additional commands, e-mail: java-dev-help@axis.apache.org
>>
>>
>