james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mwiederk...@apache.org
Subject svn commit: r731319 - /james/mime4j/trunk/benchmarks/src/org/apache/james/mime4j/LongMultipartReadBench.java
Date Sun, 04 Jan 2009 18:37:05 GMT
Author: mwiederkehr
Date: Sun Jan  4 10:37:04 2009
New Revision: 731319

URL: http://svn.apache.org/viewvc?rev=731319&view=rev
Log:
added a warm-up phase and more statistics

Modified:
    james/mime4j/trunk/benchmarks/src/org/apache/james/mime4j/LongMultipartReadBench.java

Modified: james/mime4j/trunk/benchmarks/src/org/apache/james/mime4j/LongMultipartReadBench.java
URL: http://svn.apache.org/viewvc/james/mime4j/trunk/benchmarks/src/org/apache/james/mime4j/LongMultipartReadBench.java?rev=731319&r1=731318&r2=731319&view=diff
==============================================================================
--- james/mime4j/trunk/benchmarks/src/org/apache/james/mime4j/LongMultipartReadBench.java
(original)
+++ james/mime4j/trunk/benchmarks/src/org/apache/james/mime4j/LongMultipartReadBench.java
Sun Jan  4 10:37:04 2009
@@ -60,14 +60,25 @@
         System.out.println("No of repetitions: " + repetitions);
         System.out.println("Content length: " + content.length);
         System.out.println("Test: " + test.getClass().getSimpleName());
+        
+        System.out.print("Warmup... ");
+        long t0 = System.currentTimeMillis();
+        while (System.currentTimeMillis() - t0 < 1500) {
+            test.run(content, 10);
+        }
+        System.out.println("done");
+
         System.out.println("--------------------------------");
 
         long start = System.currentTimeMillis();
         test.run(content, repetitions);
         long finish = System.currentTimeMillis();
 
-        System.out.println("Execution time: "
-                + ((double) (finish - start) / 1000) + " s");
+        double seconds = (finish - start) / 1000.0;
+        double mb = content.length * repetitions / 1024.0 / 1024;
+        System.out.printf("Execution time: %f sec\n", seconds);
+        System.out.printf("%.2f messages/sec\n", repetitions / seconds);
+        System.out.printf("%.2f mb/sec\n", mb / seconds);
     }
 
     private static Test createTest(int testNumber) {



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


Mime
View raw message