db-ojb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From arm...@apache.org
Subject cvs commit: db-ojb/src/test/org/apache/ojb/otm PerformanceTest.java
Date Tue, 26 Apr 2005 22:03:20 GMT
arminw      2005/04/26 15:03:19

  Modified:    src/doc/forrest/src/documentation/content/xdocs/docu/guides
                        Tag: OJB_1_0_RELEASE performance.xml
               src/test/org/apache/ojb/broker Tag: OJB_1_0_RELEASE
                        MultipleDBTest.java TransactionDemarcationTest.java
               src/test/org/apache/ojb Tag: OJB_1_0_RELEASE
                        repository_junit.xml
               .        Tag: OJB_1_0_RELEASE build.xml release-notes.txt
  Added:       src/test/org/apache/ojb/compare Tag: OJB_1_0_RELEASE
                        OJBPerfTest.java PerformanceArticle.java
                        PerformanceBaseTest.java
                        PerformanceJdbcFailoverTest.java
                        PerformanceJdbcTest.java PerformanceODMGTest.java
                        PerformanceOTMTest.java PerformancePBTest.java
  Removed:     src/test/org/apache/ojb/broker Tag: OJB_1_0_RELEASE
                        OJBPerfTest.java PerformanceArticle.java
                        PerformanceJdbcFailoverTest.java
                        PerformanceJdbcReferenceTest.java
                        PerformanceTest.java PerformanceTest2.java
                        PerformanceTest3.java
               src/test/org/apache/ojb/odmg Tag: OJB_1_0_RELEASE
                        PerformanceTest.java
               src/test/org/apache/ojb/otm Tag: OJB_1_0_RELEASE
                        PerformanceTest.java
  Log:
  remove outdated performance test
  introduce new package 'compare' to bunch all performance comparision tests
  
  Revision  Changes    Path
  No                   revision
  No                   revision
  1.1.2.2   +13 -15    db-ojb/src/doc/forrest/src/documentation/content/xdocs/docu/guides/performance.xml
  
  Index: performance.xml
  ===================================================================
  RCS file: /home/cvs/db-ojb/src/doc/forrest/src/documentation/content/xdocs/docu/guides/performance.xml,v
  retrieving revision 1.1.2.1
  retrieving revision 1.1.2.2
  diff -u -r1.1.2.1 -r1.1.2.2
  --- performance.xml	25 Apr 2005 17:12:06 -0000	1.1.2.1
  +++ performance.xml	26 Apr 2005 22:03:14 -0000	1.1.2.2
  @@ -73,10 +73,10 @@
               <title>The Performance Test Suite</title>
               <p>
                   The
  -                <em>OJB Performance Test Suite</em> allows to compare OJB
  +                <em>OJB Performance Test Suite</em> allows to compare all supported
OJB API's
                   against
  -                <link href="#compares-to-native">native JDBC programming</link>
  -                against your RDBMS of choice and run OJB in a
  +                <link href="#compares-to-native">native single-threaded JDBC programming</link>
  +                against your RDBMS of choice and run OJB API's in a
                   <link href="#multithreaded-performance">virtual multithreaded
                       environment</link>. Further on it is possible to
                   <link href="#compares-to-other">compare OJB against any O/R mapping
tool</link> using a simple
  @@ -94,13 +94,10 @@
                   </p>
                   <ul>
                       <li>
  -                        <code>perf-test</code> multithreaded performance/stress
test of PB/OTM/ODMG api against native JDBC
  +                        <code>perf-test</code>  multi-threaded performance/stress
test of PB/OTM/ODMG api against native JDBC
                       </li>
                       <li>
  -                        <code>performance</code> older single threaded test,
 OJB API implementations (PB, ODMG) against native JDBC
  -                    </li>
  -                    <li>[
  -                        <code>performance3</code> multithreaded test against
two different databases - developers test]
  +                        <code>performance</code>  single-threaded test, OJB
API implementations (PB, ODMG) against native JDBC
                       </li>
                   </ul>
               <p>
  @@ -323,7 +320,8 @@
                   <source><![CDATA[
       ant perf-test]]></source>
                   <p>
  -                    A typical output of this test looks like (OJB against hsql server,
2-tier, 100 MBit network):
  +                    A typical output of this test looks like (OJB against in-memory hsql,
this
  +                    shows the overhead caused by the O/R layer):
                       </p>
                   <source><![CDATA[
   [ojb] ================================================================
  @@ -366,10 +364,10 @@
           <classpath refid="runtime-classpath"/>
           <!-- comma separated list of the PerfTest implementations -->
           <arg value=
  -        "org.apache.ojb.broker.OJBPerfTest$JdbcPerfTest,
  -        org.apache.ojb.broker.OJBPerfTest$PBPerfTest,
  -        org.apache.ojb.broker.OJBPerfTest$ODMGPerfTest,
  -        org.apache.ojb.broker.OJBPerfTest$OTMPerfTest"
  +        "org.apache.ojb.compare.OJBPerfTest$JdbcPerfTest,
  +        org.apache.ojb.compare.OJBPerfTest$PBPerfTest,
  +        org.apache.ojb.compare.OJBPerfTest$ODMGPerfTest,
  +        org.apache.ojb.compare.OJBPerfTest$OTMPerfTest"
           />
           <arg value="6"/>
           <!-- test loops, default was 6 -->
  @@ -441,7 +439,7 @@
   
               <p>
                   You can find a example implementation called
  -                <code>org.apache.ojb.broker.OJBPerfTest</code> in the test-sources
directory
  +                <code>org.apache.ojb.compare.OJBPerfTest</code> in the test-sources
directory
                   under
                   <code>[db-ojb]/src/test</code> (when using source-distribution).
                   This implementation class is used to compare performance of the PB-API,
  
  
  
  No                   revision
  No                   revision
  1.15.2.2  +14 -18    db-ojb/src/test/org/apache/ojb/broker/MultipleDBTest.java
  
  Index: MultipleDBTest.java
  ===================================================================
  RCS file: /home/cvs/db-ojb/src/test/org/apache/ojb/broker/MultipleDBTest.java,v
  retrieving revision 1.15.2.1
  retrieving revision 1.15.2.2
  diff -u -r1.15.2.1 -r1.15.2.2
  --- MultipleDBTest.java	27 Jul 2004 00:31:50 -0000	1.15.2.1
  +++ MultipleDBTest.java	26 Apr 2005 22:03:15 -0000	1.15.2.2
  @@ -177,7 +177,7 @@
        */
       public void testInsertDeleteNoAutoSequence() throws Exception
       {
  -        PerformanceArticle article = createArticleWithId(Integer.MAX_VALUE - 1001);
  +        Article article = createArticleWithId(Integer.MAX_VALUE - 1001);
           PBKey secKey = TestHelper.FAR_AWAY_KEY;
   
           FarAwayClass fa = createFarAwayObjectWithId(Integer.MAX_VALUE - 1002);
  @@ -206,9 +206,8 @@
   
           defPB = PersistenceBrokerFactory.defaultPersistenceBroker();
           defPB.clearCache();
  -        Object[] pks2 = {new Integer(article.getArticleId())};
  -        Identity oid2 = new Identity(PerformanceArticle.class, PerformanceArticle.class,
pks2);
  -        PerformanceArticle article2 = (PerformanceArticle) defPB.getObjectByIdentity(oid2);
  +        Identity oid2 = defPB.serviceIdentity().buildIdentity(Article.class, article.getArticleId());
  +        Article article2 = (Article) defPB.getObjectByIdentity(oid2);
           Assert.assertNotNull("Lookup for article in default DB failed", article2);
           defPB.close();
   
  @@ -230,7 +229,7 @@
        */
       public void testInsertDeleteAutoSequenceClearCache() throws Exception
       {
  -        PerformanceArticle article = createArticle();
  +        Article article = createArticle();
           PBKey secKey = TestHelper.FAR_AWAY_KEY;
   
           FarAwayClass fa = createFarAwayObject();
  @@ -259,9 +258,8 @@
   
           defaultPB = PersistenceBrokerFactory.defaultPersistenceBroker();
           defaultPB.clearCache();
  -        Object[] pks2 = {new Integer(article.getArticleId())};
  -        Identity oid2 = new Identity(PerformanceArticle.class, PerformanceArticle.class,
pks2);
  -        PerformanceArticle article2 = (PerformanceArticle) defaultPB.getObjectByIdentity(oid2);
  +        Identity oid2 = defaultPB.serviceIdentity().buildIdentity(Article.class, article.getArticleId());
  +        Article article2 = (Article) defaultPB.getObjectByIdentity(oid2);
           Assert.assertNotNull("Lookup for article in default DB failed", article2);
           defaultPB.close();
   
  @@ -285,7 +283,7 @@
        */
       public void testInsertDeleteAutoSequence() throws Exception
       {
  -        PerformanceArticle article = createArticle();
  +        Article article = createArticle();
           PBKey secKey = TestHelper.FAR_AWAY_KEY;
   
           PersistenceBroker defaultPB = PersistenceBrokerFactory.defaultPersistenceBroker();
  @@ -310,9 +308,8 @@
           farAwayPB.close();
   
           defaultPB = PersistenceBrokerFactory.defaultPersistenceBroker();
  -        Object[] pks2 = {new Integer(article.getArticleId())};
  -        Identity oid2 = new Identity(PerformanceArticle.class, PerformanceArticle.class,
pks2);
  -        PerformanceArticle article2 = (PerformanceArticle) defaultPB.getObjectByIdentity(oid2);
  +        Identity oid2 = defaultPB.serviceIdentity().buildIdentity(Article.class, article.getArticleId());
  +        Article article2 = (Article) defaultPB.getObjectByIdentity(oid2);
           Assert.assertNotNull("Lookup for article in default DB failed", article2);
           defaultPB.close();
   
  @@ -431,10 +428,10 @@
        * @return the created PerformanceArticle object
        * @param id the primary key value for the new object
        */
  -    private PerformanceArticle createArticleWithId(int id)
  +    private Article createArticleWithId(int id)
       {
  -        PerformanceArticle ret = createArticle();
  -        ret.setArticleId(id);
  +        Article ret = createArticle();
  +        ret.setArticleId(new Integer(id));
           return ret;
       }
   
  @@ -459,14 +456,13 @@
        * factory method that createa an PerformanceArticle
        * @return the created PerformanceArticle object
        */
  -    private PerformanceArticle createArticle()
  +    private Article createArticle()
       {
  -        PerformanceArticle a = new PerformanceArticle();
  +        Article a = new Article();
           a.setArticleName("New Performance Article " + (++counter));
           a.setMinimumStock(100);
           a.setOrderedUnits(17);
           a.setPrice(0.45);
  -        a.setProductGroupId(7);
           a.setStock(234);
           a.setSupplierId(4);
           a.setUnit("bottle");
  
  
  
  1.6.2.1   +9 -10     db-ojb/src/test/org/apache/ojb/broker/TransactionDemarcationTest.java
  
  Index: TransactionDemarcationTest.java
  ===================================================================
  RCS file: /home/cvs/db-ojb/src/test/org/apache/ojb/broker/TransactionDemarcationTest.java,v
  retrieving revision 1.6
  retrieving revision 1.6.2.1
  diff -u -r1.6 -r1.6.2.1
  --- TransactionDemarcationTest.java	31 May 2004 22:57:21 -0000	1.6
  +++ TransactionDemarcationTest.java	26 Apr 2005 22:03:15 -0000	1.6.2.1
  @@ -1,19 +1,19 @@
   package org.apache.ojb.broker;
   
  +import java.util.Iterator;
  +
   import org.apache.ojb.broker.query.Criteria;
   import org.apache.ojb.broker.query.Query;
   import org.apache.ojb.broker.query.QueryByCriteria;
   import org.apache.ojb.junit.PBTestCase;
   
  -import java.util.Iterator;
  -
   /**
    *
    * @author <a href="mailto:armin@codeAuLait.de">Armin Waibel</a>
    */
   public class TransactionDemarcationTest extends PBTestCase
   {
  -    private PerformanceArticle[] articleArr;
  +    private Article[] articleArr;
       private Person[] personArr;
       private static final int COUNT = 20;
   
  @@ -25,10 +25,10 @@
       public void setUp() throws Exception
       {
           super.setUp();
  -        articleArr = new PerformanceArticle[COUNT];
  +        articleArr = new Article[COUNT];
           for (int i = 0; i < COUNT; i++)
           {
  -            PerformanceArticle a = createArticle(i);
  +            Article a = createArticle(i);
               articleArr[i] = a;
           }
   
  @@ -125,7 +125,7 @@
       public void testIterator() throws Exception
       {
           Criteria c = new Criteria();
  -        Query q = new QueryByCriteria(PerformanceArticle.class, c);
  +        Query q = new QueryByCriteria(Article.class, c);
           Iterator it = broker.getIteratorByQuery(q);
           it.hasNext();
       }
  @@ -133,7 +133,7 @@
       public int getArticleCount()
       {
           Criteria c = new Criteria();
  -        Query q = new QueryByCriteria(PerformanceArticle.class, c);
  +        Query q = new QueryByCriteria(Article.class, c);
           int count = 0;
           count = broker.getCount(q);
           return count;
  @@ -148,14 +148,13 @@
           return count;
       }
   
  -    private PerformanceArticle createArticle(int counter)
  +    private Article createArticle(int counter)
       {
  -        PerformanceArticle a = new PerformanceArticle();
  +        Article a = new Article();
           a.setArticleName("New Performance Article " + counter);
           a.setMinimumStock(100);
           a.setOrderedUnits(17);
           a.setPrice(0.45);
  -        a.setProductGroupId(7);
           a.setStock(234);
           a.setSupplierId(4);
           a.setUnit("bottle");
  
  
  
  No                   revision
  No                   revision
  1.1.2.1   +814 -0    db-ojb/src/test/org/apache/ojb/compare/Attic/OJBPerfTest.java
  
  
  
  
  1.1.2.1   +228 -0    db-ojb/src/test/org/apache/ojb/compare/Attic/PerformanceArticle.java
  
  
  
  
  1.1.2.1   +228 -0    db-ojb/src/test/org/apache/ojb/compare/Attic/PerformanceBaseTest.java
  
  
  
  
  1.1.2.1   +676 -0    db-ojb/src/test/org/apache/ojb/compare/Attic/PerformanceJdbcFailoverTest.java
  
  
  
  
  1.1.2.1   +356 -0    db-ojb/src/test/org/apache/ojb/compare/Attic/PerformanceJdbcTest.java
  
  
  
  
  1.1.2.1   +187 -0    db-ojb/src/test/org/apache/ojb/compare/Attic/PerformanceODMGTest.java
  
  
  
  
  1.1.2.1   +187 -0    db-ojb/src/test/org/apache/ojb/compare/Attic/PerformanceOTMTest.java
  
  
  
  
  1.1.2.1   +159 -0    db-ojb/src/test/org/apache/ojb/compare/Attic/PerformancePBTest.java
  
  
  
  
  No                   revision
  No                   revision
  1.112.2.13 +3 -3      db-ojb/src/test/org/apache/ojb/repository_junit.xml
  
  Index: repository_junit.xml
  ===================================================================
  RCS file: /home/cvs/db-ojb/src/test/org/apache/ojb/repository_junit.xml,v
  retrieving revision 1.112.2.12
  retrieving revision 1.112.2.13
  diff -u -r1.112.2.12 -r1.112.2.13
  --- repository_junit.xml	22 Apr 2005 16:42:22 -0000	1.112.2.12
  +++ repository_junit.xml	26 Apr 2005 22:03:17 -0000	1.112.2.13
  @@ -1175,9 +1175,9 @@
         />
      </class-descriptor>
   
  -<!-- Definitions for org.apache.ojb.broker.PerformanceArticle -->
  +<!-- Definitions for org.apache.ojb.compare.PerformanceArticle -->
      <class-descriptor
  -   	  class="org.apache.ojb.broker.PerformanceArticle"
  +   	  class="org.apache.ojb.compare.PerformanceArticle"
      	  table="Artikel"
      >
         <field-descriptor
  
  
  
  No                   revision
  No                   revision
  1.144.2.24 +11 -48    db-ojb/build.xml
  
  Index: build.xml
  ===================================================================
  RCS file: /home/cvs/db-ojb/build.xml,v
  retrieving revision 1.144.2.23
  retrieving revision 1.144.2.24
  diff -u -r1.144.2.23 -r1.144.2.24
  --- build.xml	22 Apr 2005 16:42:23 -0000	1.144.2.23
  +++ build.xml	26 Apr 2005 22:03:18 -0000	1.144.2.24
  @@ -1250,38 +1250,38 @@
       <target name="performance" depends="prepare-repository, copy-testdb"
               description="Performance benchmark, compare the PB-api/ODMG-api
               with direct JDBC calls">
  -        <java fork="yes" classname="org.apache.ojb.broker.PerformanceTest"
  +        <java fork="yes" classname="org.apache.ojb.compare.PerformancePBTest"
                 dir="${build.test}/ojb" taskname="ojb" failonerror="true" >
               <classpath refid="runtime-classpath"/>
  -            <arg value="2500"/>
  +            <arg value="1500"/>
               <arg value="3"/>
               <jvmarg value="-Xms128m"/>
               <jvmarg value="-Xmx256m"/>
           </java>
   
  -        <java fork="yes" classname="org.apache.ojb.broker.PerformanceJdbcReferenceTest"
  +        <java fork="yes" classname="org.apache.ojb.compare.PerformanceJdbcTest"
                 dir="${build.test}/ojb" taskname="jdbc" failonerror="true" >
               <classpath refid="runtime-classpath"/>
  -            <arg value="2500"/>
  +            <arg value="1500"/>
               <arg value="3"/>
               <jvmarg value="-Xms128m"/>
               <jvmarg value="-Xmx256m"/>
               <!--jvmarg value="-Xrunhprof:cpu=times,file=perf.hprof.txt" /-->
           </java>
   
  -        <java fork="yes" classname="org.apache.ojb.odmg.PerformanceTest"
  +        <java fork="yes" classname="org.apache.ojb.compare.PerformanceODMGTest"
                 dir="${build.test}/ojb" taskname="odmg" failonerror="true" >
               <classpath refid="runtime-classpath"/>
  -            <arg value="500"/>
  +            <arg value="1500"/>
               <arg value="3"/>
               <jvmarg value="-Xms128m"/>
               <jvmarg value="-Xmx256m"/>
           </java>
   
  -        <java fork="yes" classname="org.apache.ojb.otm.PerformanceTest"
  +        <java fork="yes" classname="org.apache.ojb.compare.PerformanceOTMTest"
                 dir="${build.test}/ojb" taskname="otm" failonerror="true" >
               <classpath refid="runtime-classpath"/>
  -            <arg value="500"/>
  +            <arg value="1500"/>
               <arg value="3"/>
               <jvmarg value="-Xms128m"/>
               <jvmarg value="-Xmx256m"/>
  @@ -1289,29 +1289,11 @@
       </target>
   
       <!-- ================================================================== -->
  -    <!-- Performance tests 2 / stress test                                  -->
  -    <!-- ================================================================== -->
  -    <target name="performance2" depends="prepare-testdb"
  -            description="Performance benchmark and stress test for PB- and ODMG-api">
  -        <java fork="yes" classname="org.apache.ojb.broker.PerformanceTest2"
  -              dir="${build.test}/ojb" taskname="ojb" failonerror="true" >
  -            <classpath refid="runtime-classpath"/>
  -            <arg value="10"/> <!-- performed threads, default was 10 -->
  -			<arg value="2000"/> <!-- iterations per thread, default was 2000 -->
  -            <arg value="false"/> <!-- if 'false' we use autoincrement key generation,
default false -->
  -            <arg value="7"/> <!-- 1 = PB-test, 2 = ODMG-test, 3 = Both, 4 = OTM-test,
7 = All three tests, default was 7 -->
  -            <arg value="3"/> <!-- Number of test loops, default was 3 -->
  -            <jvmarg value="-Xms128m"/>
  -            <jvmarg value="-Xmx256m"/>
  -        </java>
  -    </target>
  -
  -    <!-- ================================================================== -->
       <!-- failover tests                                                  -->
       <!-- ================================================================== -->
       <target name="failover"
               description="db failover tests">
  -        <java fork="yes" classname="org.apache.ojb.broker.PerformanceJdbcFailoverTest"
  +        <java fork="yes" classname="org.apache.ojb.compare.PerformanceJdbcFailoverTest"
                 dir="${build.test}/ojb" taskname="ojb" failonerror="true" >
               <classpath refid="runtime-classpath"/>
               <arg value="10000"/> <!-- number of operations per run-->
  @@ -1334,7 +1316,7 @@
               <classpath refid="runtime-classpath"/>
               <!-- comma separated list of the PerfTest implementations -->
               <arg value=
  -            "org.apache.ojb.broker.OJBPerfTest$JdbcPerfTest,org.apache.ojb.broker.OJBPerfTest$PBPerfTest,org.apache.ojb.broker.OJBPerfTest$ODMGPerfTest,org.apache.ojb.broker.OJBPerfTest$OTMPerfTest"
  +            "org.apache.ojb.compare.OJBPerfTest$JdbcPerfTest,org.apache.ojb.compare.OJBPerfTest$PBPerfTest,org.apache.ojb.compare.OJBPerfTest$ODMGPerfTest,org.apache.ojb.compare.OJBPerfTest$OTMPerfTest"
               />
               <arg value="6"/> <!-- test loops, default was 6 -->
               <arg value="12"/> <!-- performed threads, default was 12 -->
  @@ -1375,25 +1357,6 @@
       </target>
   
       <!-- ================================================================== -->
  -    <!-- Performance tests 3 / stress test multiple db                      -->
  -    <!-- ================================================================== -->
  -    <target name="performance3" depends="prepare-testdb"
  -            description="Stress test for PB- and ODMG-api using multiple
  -            databases">
  -        <java fork="yes" classname="org.apache.ojb.broker.PerformanceTest3"
  -              dir="${build.test}/ojb" taskname="ojb" failonerror="true" >
  -            <classpath refid="runtime-classpath"/>
  -            <arg value="5"/> <!-- performed threads, default was 5 -->
  -			<arg value="100"/> <!-- iterations per thread, default was 100 -->
  -            <arg value="false"/> <!-- if 'false' we use autoincrement key generation,
default false -->
  -            <arg value="3"/> <!-- 1 = PB-test, 2 = ODMG-test, 3 = Both, default
was 3 -->
  -            <arg value="2"/> <!-- Number of test loops, default was 3 -->
  -            <jvmarg value="-Xms128m"/>
  -            <jvmarg value="-Xmx256m"/>
  -        </java>
  -    </target>
  -
  -    <!-- ================================================================== -->
       <!-- Browse Demo Database                                               -->
       <!-- ================================================================== -->
       <target name="browse-db" depends="init"
  
  
  
  1.54.2.46 +11 -1     db-ojb/release-notes.txt
  
  Index: release-notes.txt
  ===================================================================
  RCS file: /home/cvs/db-ojb/release-notes.txt,v
  retrieving revision 1.54.2.45
  retrieving revision 1.54.2.46
  diff -u -r1.54.2.45 -r1.54.2.46
  --- release-notes.txt	26 Apr 2005 03:41:37 -0000	1.54.2.45
  +++ release-notes.txt	26 Apr 2005 22:03:18 -0000	1.54.2.46
  @@ -23,8 +23,18 @@
   * [OJB-6] - Support for stored procedures returning ResultSet.
   
   NOTES:
  +* Internal OJB class configuration files are changed, don't forget to replace
  +  these files on upgrade from older version (by default the internal used
  +  classes are located in repository_internal.xml).
  +* Improved performance comparison tests ('ant perf-test' and 'ant performance').
  +  Now the tests more fair for registered API's
   
   CHANGES:
  +* Removed deprecated SequenceManager implementation SequenceManagerMySQLImpl
  +* Remove unused method from SequenceManager interface
  +* Internal used OJB_HL_SEQ table changed. Remove of deprecated column.
  +  If the SequenceManagerHighLowImpl was used and problems occur after upgrade, please
  +  drop and recreate this table without removed column
   * Upgraded ANTLR to v2.7.5 (OQL and JDOQL parser classes have been re-generated)
   * Upgraded commons-dbcp to v1.2.1
   * Upgraded commons-pool to v1.2
  
  
  

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


Mime
View raw message