Author: dkulp
Date: Fri Jul 18 11:46:40 2008
New Revision: 677996
URL: http://svn.apache.org/viewvc?rev=677996&view=rev
Log:
Minor updates to the perf thing to be what I was testing with the chunking stuff
Modified:
cxf/trunk/benchmark/performance/base/src/org/apache/cxf/pat/internal/TestCaseBase.java
cxf/trunk/benchmark/performance/soap_http_doc_lit/src/org/apache/cxf/performance/complex_type/client/Client.java
Modified:
cxf/trunk/benchmark/performance/base/src/org/apache/cxf/pat/internal/TestCaseBase.java
URL:
http://svn.apache.org/viewvc/cxf/trunk/benchmark/performance/base/src/org/apache/cxf/pat/internal/TestCaseBase.java?rev=677996&r1=677995&r2=677996&view=diff
==============================================================================
---
cxf/trunk/benchmark/performance/base/src/org/apache/cxf/pat/internal/TestCaseBase.java
(original)
+++
cxf/trunk/benchmark/performance/base/src/org/apache/cxf/pat/internal/TestCaseBase.java
Fri Jul 18 11:46:40 2008
@@ -183,19 +183,26 @@
return;
}
- System.out.println("TestCase " + name + " is warming up the jit.
(20 sec/1200 iterations)");
- final long endTime = System.currentTimeMillis() + 20000;
+ final int threadCount = 4;
+ final long timeLimit = 30;
+ final int countLimit = 1200;
+
+ System.out.println("TestCase " + name + " is warming up the jit.
(" + timeLimit + " sec/" + countLimit + " iterations, " + threadCount + "
threads)");
+ final long startTime = System.currentTimeMillis();
+ final long endTime = startTime + (timeLimit * 1000l);
final T t = getPort();
- for (int x = 0; x < 12; x++) {
+ for (int x = 0; x < (threadCount - 1); x++) {
new Thread() {
public void run() {
try {
int count = 0;
- while (count < 1200 || System.currentTimeMillis()
< endTime) {
+ while (count < countLimit ||
System.currentTimeMillis() < endTime) {
count++;
doJob(t);
}
+ //System.out.println(count);
+ //System.out.println("" +
(System.currentTimeMillis() - startTime));
} catch ( Exception ex ) {
ex.printStackTrace();
}
@@ -205,12 +212,15 @@
}
int count = 0;
- while (count < 1200 || System.currentTimeMillis() < endTime) {
+ while (count < countLimit || System.currentTimeMillis() < endTime)
{
count++;
doJob(t);
}
- while (initDone != 12) {
- Thread.sleep(100);
+ //System.out.println(count);
+ //System.out.println("" + (System.currentTimeMillis() -
startTime));
+ ++initDone;
+ while (initDone != threadCount) {
+ Thread.sleep(100);
}
} catch (Exception e) {
e.printStackTrace();
Modified:
cxf/trunk/benchmark/performance/soap_http_doc_lit/src/org/apache/cxf/performance/complex_type/client/Client.java
URL:
http://svn.apache.org/viewvc/cxf/trunk/benchmark/performance/soap_http_doc_lit/src/org/apache/cxf/performance/complex_type/client/Client.java?rev=677996&r1=677995&r2=677996&view=diff
==============================================================================
---
cxf/trunk/benchmark/performance/soap_http_doc_lit/src/org/apache/cxf/performance/complex_type/client/Client.java
(original)
+++
cxf/trunk/benchmark/performance/soap_http_doc_lit/src/org/apache/cxf/performance/complex_type/client/Client.java
Fri Jul 18 11:46:40 2008
@@ -184,11 +184,9 @@
}
complexType.setVarEnum(ColourEnum.RED);
- byte[] binary = new byte[256 * packetSize];
- for (int idx = 0; idx < 1 * packetSize; idx++) {
- for (int jdx = 0; jdx < 256; jdx++) {
- binary[idx * 256 + jdx] = (byte)(jdx - 128);
- }
+ byte[] binary = new byte[256];
+ for (int jdx = 0; jdx < 256; jdx++) {
+ binary[jdx] = (byte)(jdx - 128);
}
complexType.setVarHexBinary(binary);
complexType.setVarBase64Binary(binary);
@@ -196,24 +194,25 @@
}
public void initTestData() {
- //for (int i = 0; i < packetSize; i++) {
NestedComplexType ct = createComplexType();
- for (int i = 0; i < 1; i++) {
+ for (int i = 0; i < packetSize; i++) {
complexTypeSeq.getItem().add(ct);
}
// init String and Binary
String temp = "[EMAIL PROTECTED]&*()_+?><[]/0123456789";
- inputBase64 = new byte[1024 * packetSize];
- for (int idx = 0; idx < 4 * packetSize; idx++) {
+ inputBase64 = new byte[1024];
+ for (int idx = 0; idx < 4; idx++) {
for (int jdx = 0; jdx < 256; jdx++) {
inputBase64[idx * 256 + jdx] = (byte)(jdx - 128);
}
}
+ StringBuilder builder = new StringBuilder(packetSize * 1024);
+ builder.append(inputString);
for (int i = 0; i < asciiCount / temp.length() * packetSize; i++) {
- inputString = inputString + temp;
+ builder.append(temp);
}
-
+ inputString = builder.toString();
}
public void doJob(DocPortType port) {