You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by ma...@apache.org on 2010/11/30 14:41:09 UTC

svn commit: r1040516 - /tomcat/trunk/test/org/apache/catalina/session/Benchmarks.java

Author: markt
Date: Tue Nov 30 13:41:09 2010
New Revision: 1040516

URL: http://svn.apache.org/viewvc?rev=1040516&view=rev
Log:
Align tests with new ManagerBase code
Update OSX figures - now comparable

Modified:
    tomcat/trunk/test/org/apache/catalina/session/Benchmarks.java

Modified: tomcat/trunk/test/org/apache/catalina/session/Benchmarks.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/catalina/session/Benchmarks.java?rev=1040516&r1=1040515&r2=1040516&view=diff
==============================================================================
--- tomcat/trunk/test/org/apache/catalina/session/Benchmarks.java (original)
+++ tomcat/trunk/test/org/apache/catalina/session/Benchmarks.java Tue Nov 30 13:41:09 2010
@@ -43,10 +43,10 @@ public class Benchmarks extends TestCase
      * 16 threads - ~14,700ms
      * 
      * Results on markt's 2-core OSX dev box
-     *  1 thread  -   ~4,700ms
-     *  2 threads -  ~ 6,000ms
-     *  4 threads -  ~11,900ms
-     * 16 threads -  ~48,659ms
+     *  1 thread  -   ~1,400ms
+     *  2 threads -   ~1,700ms
+     *  4 threads -   ~3,500ms
+     * 16 threads -  ~14,465ms
      */
     public void testManagerBaseGenerateSessionId() throws Exception {
         doTestManagerBaseGenerateSessionId(1, 1000000);
@@ -141,10 +141,10 @@ public class Benchmarks extends TestCase
      * 16 threads - ~43,500ms
      * 
      * Results on markt's 2-core OSX dev box
-     *  1 thread  -  ~9,100ms
-     *  2 threads - ~10,800ms
-     *  4 threads - ~21,400ms
-     * 16 threads - ~87,600ms
+     *  1 thread  -  ~4,100ms
+     *  2 threads -  ~5,700ms
+     *  4 threads - ~11,700ms
+     * 16 threads - ~45,600ms
      */
     public void testManagerBaseCreateSession() {
         doTestManagerBaseCreateSession(1, 1000000);
@@ -236,9 +236,9 @@ public class Benchmarks extends TestCase
      *  
      * Results on markt's 2-core OSX dev box
      *              SecureRandom  /dev/urandom
-     *  1 thread  -   ~4,100ms      ~3,500ms
-     *  2 threads -  ~10,700ms      ~5,100ms
-     *  4 threads -  ~20,700ms     ~10,700ms
+     *  1 thread  -     ~759ms      ~3,500ms
+     *  2 threads -     ~725ms      ~5,200ms
+     *  4 threads -   ~1,265ms     ~10,500ms
      */
     public void testSecureRandomVsDevURandom() throws Exception {
         doTestSecureRandomVsDevURandom(1, 1000000);
@@ -246,13 +246,14 @@ public class Benchmarks extends TestCase
         doTestSecureRandomVsDevURandom(4, 1000000);
     }
 
-    private void doTestSecureRandomVsDevURandom(int threadCount, int iterCount) {
+    private void doTestSecureRandomVsDevURandom(int threadCount, int iterCount)
+            throws Exception {
         doTestSecureRandomVsDevURandomInner(threadCount, iterCount, true);
         doTestSecureRandomVsDevURandomInner(threadCount, iterCount, false);
     }
 
     private void doTestSecureRandomVsDevURandomInner(int threadCount,
-            int iterCount, boolean useSecureRandom) {
+            int iterCount, boolean useSecureRandom) throws Exception {
 
         Thread[] threads = new Thread[threadCount];
         
@@ -294,12 +295,13 @@ public class Benchmarks extends TestCase
 
     private static final class TestThreadSecureRandom implements Runnable {
         
-        private SecureRandom secureRandom = new SecureRandom();
+        private SecureRandom secureRandom;
         private byte[] bytes = new byte[16];
         private int count;
         
-        TestThreadSecureRandom(int iterCount) {
+        TestThreadSecureRandom(int iterCount) throws Exception {
             this.count = iterCount;
+            this.secureRandom = SecureRandom.getInstance("SHA1PRNG");
         }
 
         @Override



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


Re: svn commit: r1040516 - /tomcat/trunk/test/org/apache/catalina/session/Benchmarks.java

Posted by Mark Thomas <ma...@apache.org>.
On 30/11/2010 13:41, markt@apache.org wrote:
> Author: markt
> Date: Tue Nov 30 13:41:09 2010
> New Revision: 1040516
> 
> URL: http://svn.apache.org/viewvc?rev=1040516&view=rev
> Log:
> Align tests with new ManagerBase code
> Update OSX figures - now comparable

With these test results, I'm planning on drawing a line under my
ManagerBase changes. I am sure there is room for further improvement but
I don't think this is where the bottlenecks are in the request
processing chain.

Mark

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