Raul,

Hmm. This one is caused ant test to break on my system. So I did a minor change and it's all working.

It hasn't made a big difference to ant test - but there is a difference, so I'll do a re-package and distribute today. (But that's it - no more for 1.1 :>.)

These speed improvements have been fantastic! Maybe something a few of us could do post 1.1 is work with you to look for other opportunities to make these kind of increases? My read is that we should be seriously digging through the library to find all usage of XPath and removing it unless it's absolutely required.

It's interesting - the C++ library is very minimalistic in its use of XPath, because making use of Xalan C++ is a bit trickier than using Xalan-J. So it got avoided wherever possible. But it does prove that you can avoid XPath for everything other than XPath transforms.

Thanks again!

Cheers,
        Berin

[EMAIL PROTECTED] wrote:

Sorry for been repetivie, but here is another patch to increase the speedup a little(not us big as the first one but significant).
It seems that create a CacheXPathAPI is a really expensive operation, and it's better to postpone it till if it's ever needed.


Please test it.

Thanks.

Index: XMLSignatureInput.java
===================================================================
RCS file: /home/cvspublic/xml-security/src/org/apache/xml/security/signature/XMLSignatureInput.java,v


retrieving revision 1.24
diff -u -r1.24 XMLSignatureInput.java
--- XMLSignatureInput.java    8 Feb 2004 06:11:19 -0000    1.24
+++ XMLSignatureInput.java    16 Apr 2004 15:52:05 -0000
@@ -88,7 +88,7 @@
      System.arraycopy(inputOctets, 0, copy, 0, inputOctets.length);

      this._inputOctetStreamProxy = new ByteArrayInputStream(copy);
-      this._cxpathAPI = new CachedXPathAPI();
+      //this._cxpathAPI = new CachedXPathAPI();
   }

   /**
@@ -182,7 +182,7 @@
    * @param inputNodeSet
    */
   public XMLSignatureInput(Set inputNodeSet) {
-      this(inputNodeSet, new CachedXPathAPI());
+      this(inputNodeSet, null);
   }

   /**
@@ -240,6 +240,9 @@
            XMLUtils.circumventBug2650(doc);

            // select all nodes, also the comments.
+            if (this._cxpathAPI==null) {
+                this._cxpathAPI=new CachedXPathAPI();
+            }
            NodeList nodeList =
               this._cxpathAPI
                  .selectNodeList(doc,



Reply via email to