[jbosscache-commits] JBoss Cache SVN: r5789 - core/trunk/src/test/java/org/jboss/cache/profiling.

jbosscache-commits at lists.jboss.org jbosscache-commits at lists.jboss.org
Thu May 1 12:15:48 EDT 2008


Author: manik.surtani at jboss.com
Date: 2008-05-01 12:15:48 -0400 (Thu, 01 May 2008)
New Revision: 5789

Removed:
   core/trunk/src/test/java/org/jboss/cache/profiling/StringPerformanceTest.java
Log:
Whoops!

Deleted: core/trunk/src/test/java/org/jboss/cache/profiling/StringPerformanceTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/profiling/StringPerformanceTest.java	2008-05-01 16:15:04 UTC (rev 5788)
+++ core/trunk/src/test/java/org/jboss/cache/profiling/StringPerformanceTest.java	2008-05-01 16:15:48 UTC (rev 5789)
@@ -1,107 +0,0 @@
-package org.jboss.cache.profiling;
-
-import org.jboss.cache.Fqn;
-import org.testng.annotations.Test;
-
-/**
- * A micro benchmark that measures the performance of using the old Fqn constructors versus the new Factory methods.
- *
- * @author Manik Surtani (<a href="mailto:manik at jboss.org">manik at jboss.org</a>)
- * @since 2.2.0
- */
- at Test(groups = "manual")
-public class StringPerformanceTest
-{
-   private static final int WARMUP = 200000;
-   private static final int LOOPS = 2000000;
-
-   public void testConstruction()
-   {
-      // perform a series of warmp constructions first
-      for (int i = 0; i < WARMUP; i++)
-      {
-         new Fqn("Hello", "World", "How", "Are", "You");
-         Fqn.fromElements("Hello", "World", "How", "Are", "You");
-//         Fqn.fromString("/Hello/World/How/Are/You");
-      }
-
-      // now do the actual microbench
-      long start = System.currentTimeMillis();
-      for (int i = 0; i < LOOPS; i++)
-      {
-         new Fqn("Hello", "World", "How", "Are", "You");
-      }
-      long oldTime = System.currentTimeMillis() - start;
-
-      start = System.currentTimeMillis();
-      for (int i = 0; i < LOOPS; i++)
-      {
-         Fqn.fromElements("Hello", "World", "How", "Are", "You");
-//         Fqn.fromString("/Hello/World/How/Are/You");
-      }
-      long newTime = System.currentTimeMillis() - start;
-
-      System.out.println("Old Constructors: " + oldTime + ", new factory: " + newTime);
-   }
-
-   public void testHashcode()
-   {
-      // perform a series of warmp constructions first
-      for (int i = 0; i < WARMUP; i++)
-      {
-         new Fqn("Hello", "World", "How", "Are", "You").hashCode();
-         Fqn.fromElements("Hello", "World", "How", "Are", "You").hashCode();
-      }
-
-      // now do the actual microbench
-      long start = System.currentTimeMillis();
-      for (int i = 0; i < LOOPS; i++)
-      {
-         new Fqn("Hello", "World", "How", "Are", "You").hashCode();
-      }
-      long oldTime = System.currentTimeMillis() - start;
-
-      start = System.currentTimeMillis();
-      for (int i = 0; i < LOOPS; i++)
-      {
-         Fqn.fromElements("Hello", "World", "How", "Are", "You").hashCode();
-      }
-      long newTime = System.currentTimeMillis() - start;
-
-      System.out.println("Old Constructors: " + oldTime + ", new factory: " + newTime);
-   }
-
-   public void testEquals()
-   {
-      // perform a series of warmp constructions first
-      for (int i = 0; i < WARMUP; i++)
-      {
-         Fqn f1 = new Fqn("Hello", "World", "How", "Are", "You");
-         Fqn f2 = Fqn.fromElements("Hello", "World", "How", "Are", "You");
-         f1.equals(f2);
-         f2.equals(f1);
-      }
-
-      Fqn compareTo = new Fqn("Hello", "World", "How", "Are", "You");
-      Fqn toTest = new Fqn("Hello", "World", "How", "Are", "You");
-      // now do the actual microbench
-      long start = System.currentTimeMillis();
-      for (int i = 0; i < LOOPS; i++)
-      {
-         toTest.equals(compareTo);
-      }
-      long oldTime = System.currentTimeMillis() - start;
-
-      compareTo = Fqn.fromElements("Hello", "World", "How", "Are", "You");
-      toTest = Fqn.fromElements("Hello", "World", "How", "Are", "You");
-
-      start = System.currentTimeMillis();
-      for (int i = 0; i < LOOPS; i++)
-      {
-         toTest.equals(compareTo);
-      }
-      long newTime = System.currentTimeMillis() - start;
-
-      System.out.println("Old Constructors: " + oldTime + ", new factory: " + newTime);
-   }
-}




More information about the jbosscache-commits mailing list