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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]