From jbosscache-commits at lists.jboss.org Thu May 1 12:15:48 2008 Content-Type: multipart/mixed; boundary="===============0305334687343589144==" MIME-Version: 1.0 From: jbosscache-commits at lists.jboss.org To: jbosscache-commits at lists.jboss.org Subject: [jbosscache-commits] JBoss Cache SVN: r5789 - core/trunk/src/test/java/org/jboss/cache/profiling. Date: Thu, 01 May 2008 12:15:48 -0400 Message-ID: --===============0305334687343589144== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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/StringPerforman= ceTest.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- core/trunk/src/test/java/org/jboss/cache/profiling/StringPerformanceTes= t.java 2008-05-01 16:15:04 UTC (rev 5788) +++ core/trunk/src/test/java/org/jboss/cache/profiling/StringPerformanceTes= t.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 co= nstructors versus the new Factory methods. - * - * @author Manik Surtani (manik(a)jbo= ss.org) - * @since 2.2.0 - */ -(a)Test(groups =3D "manual") -public class StringPerformanceTest -{ - private static final int WARMUP =3D 200000; - private static final int LOOPS =3D 2000000; - - public void testConstruction() - { - // perform a series of warmp constructions first - for (int i =3D 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 =3D System.currentTimeMillis(); - for (int i =3D 0; i < LOOPS; i++) - { - new Fqn("Hello", "World", "How", "Are", "You"); - } - long oldTime =3D System.currentTimeMillis() - start; - - start =3D System.currentTimeMillis(); - for (int i =3D 0; i < LOOPS; i++) - { - Fqn.fromElements("Hello", "World", "How", "Are", "You"); -// Fqn.fromString("/Hello/World/How/Are/You"); - } - long newTime =3D 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 =3D 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 =3D System.currentTimeMillis(); - for (int i =3D 0; i < LOOPS; i++) - { - new Fqn("Hello", "World", "How", "Are", "You").hashCode(); - } - long oldTime =3D System.currentTimeMillis() - start; - - start =3D System.currentTimeMillis(); - for (int i =3D 0; i < LOOPS; i++) - { - Fqn.fromElements("Hello", "World", "How", "Are", "You").hashCode(= ); - } - long newTime =3D 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 =3D 0; i < WARMUP; i++) - { - Fqn f1 =3D new Fqn("Hello", "World", "How", "Are", "You"); - Fqn f2 =3D Fqn.fromElements("Hello", "World", "How", "Are", "You"= ); - f1.equals(f2); - f2.equals(f1); - } - - Fqn compareTo =3D new Fqn("Hello", "World", "How", "Are", "You"); - Fqn toTest =3D new Fqn("Hello", "World", "How", "Are", "You"); - // now do the actual microbench - long start =3D System.currentTimeMillis(); - for (int i =3D 0; i < LOOPS; i++) - { - toTest.equals(compareTo); - } - long oldTime =3D System.currentTimeMillis() - start; - - compareTo =3D Fqn.fromElements("Hello", "World", "How", "Are", "You"= ); - toTest =3D Fqn.fromElements("Hello", "World", "How", "Are", "You"); - - start =3D System.currentTimeMillis(); - for (int i =3D 0; i < LOOPS; i++) - { - toTest.equals(compareTo); - } - long newTime =3D System.currentTimeMillis() - start; - - System.out.println("Old Constructors: " + oldTime + ", new factory: = " + newTime); - } -} --===============0305334687343589144==--