I don't know what to belive but this 2 line patch gives me a speed up of two times.
The output of my test program(signs 300 times the same DOM, don't be fool with native or Sun they are the same provider)
Before the patch: Calentando: 12496ms (100 signs) SUN: 10923ms (100 signs) Native: 10706ms (100 signs)
After the patch: Calentando: 5603ms (100 signs) SUN: 4385ms (100 signs) Native: 4352ms (100 signs)
More or less two times,
Please can you all test it and tellme if you see the same speed-up. It is very weird.
Regards,
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:25:55 -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(); }
/**
@@ -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,