Author: manik.surtani(a)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@jboss.org">manik@jboss.org</a>)
- * @since 2.2.0
- */
-@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);
- }
-}