You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commons-dev@ws.apache.org by sc...@apache.org on 2008/01/18 01:18:47 UTC

svn commit: r613019 - /webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/attachments/Attachments.java

Author: scheu
Date: Thu Jan 17 16:18:46 2008
New Revision: 613019

URL: http://svn.apache.org/viewvc?rev=613019&view=rev
Log:
Quick Performance Fix
Contributor:Rich Scheuerle
Fix Suggested By: David Strite
The getAllContentIDs logic is changed to avoid using iterators.  
This small two line change had approximately 1% throughput improvement for 
an echo test (w/o attachments).

Modified:
    webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/attachments/Attachments.java

Modified: webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/attachments/Attachments.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/attachments/Attachments.java?rev=613019&r1=613018&r2=613019&view=diff
==============================================================================
--- webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/attachments/Attachments.java (original)
+++ webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/attachments/Attachments.java Thu Jan 17 16:18:46 2008
@@ -426,8 +426,11 @@
     }
 
     public String[] getAllContentIDs() {
-        Set keys = getContentIDSet();
-        return (String[]) keys.toArray(new String[keys.size()]);
+        // Force reading of all attachments
+        getContentIDSet();
+        
+        String[] strings = new String[cids.size()];
+        return (String[]) cids.toArray(strings);
     }
 
     public Set getContentIDSet() {



---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: commons-dev-help@ws.apache.org