directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r952477 - in /directory/apacheds/trunk: core-api/src/main/java/org/apache/directory/server/core/entry/ core-integ/src/test/java/org/apache/directory/server/core/operations/delete/ core-integ/src/test/java/org/apache/directory/server/core/op...
Date Mon, 07 Jun 2010 23:02:10 GMT
Author: elecharny
Date: Mon Jun  7 23:02:10 2010
New Revision: 952477

URL: http://svn.apache.org/viewvc?rev=952477&view=rev
Log:
o Removed the Entry cloning in the ClonedServerEntry creation
o Added some more accurate informations in the perfTest

Modified:
    directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/entry/ClonedServerEntry.java
    directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/operations/delete/DeletePerfIT.java
    directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/operations/lookup/LookupPerfIT.java
    directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/operations/modify/ModifyPerfIT.java
    directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/operations/search/SearchPerfIT.java

Modified: directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/entry/ClonedServerEntry.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/entry/ClonedServerEntry.java?rev=952477&r1=952476&r2=952477&view=diff
==============================================================================
--- directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/entry/ClonedServerEntry.java
(original)
+++ directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/entry/ClonedServerEntry.java
Mon Jun  7 23:02:10 2010
@@ -51,10 +51,13 @@ public class ClonedServerEntry implement
     /** The copied entry */
     protected Entry clonedEntry;
 
+    /**
+     * Creates a new instance of ClonedServerEntry.
+     */
     public ClonedServerEntry()
     {
-        
     }
+
     
     /**
      * Creates a new instance of ClonedServerEntry.
@@ -65,7 +68,7 @@ public class ClonedServerEntry implement
      */
     public ClonedServerEntry( Entry originalEntry )
     {
-        this.originalEntry = ( Entry )originalEntry.clone();
+        this.originalEntry = originalEntry;
         this.clonedEntry = ( Entry ) originalEntry.clone();
     }
     

Modified: directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/operations/delete/DeletePerfIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/operations/delete/DeletePerfIT.java?rev=952477&r1=952476&r2=952477&view=diff
==============================================================================
--- directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/operations/delete/DeletePerfIT.java
(original)
+++ directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/operations/delete/DeletePerfIT.java
Mon Jun  7 23:02:10 2010
@@ -19,14 +19,7 @@
  */
 package org.apache.directory.server.core.operations.delete;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
-
 import org.apache.directory.ldap.client.api.LdapConnection;
-import org.apache.directory.ldap.client.api.message.SearchResponse;
-import org.apache.directory.ldap.client.api.message.SearchResultEntry;
-import org.apache.directory.server.core.annotations.ApplyLdifs;
 import org.apache.directory.server.core.annotations.ContextEntry;
 import org.apache.directory.server.core.annotations.CreateDS;
 import org.apache.directory.server.core.annotations.CreateIndex;
@@ -37,7 +30,6 @@ import org.apache.directory.server.core.
 import org.apache.directory.shared.ldap.entry.DefaultEntry;
 import org.apache.directory.shared.ldap.entry.Entry;
 import org.apache.directory.shared.ldap.name.DN;
-import org.junit.Ignore;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 
@@ -102,7 +94,6 @@ public class DeletePerfIT extends Abstra
      * Test an add operation performance
      */
     @Test
-    @Ignore
     public void testDeletePerf() throws Exception
     {
         LdapConnection connection = IntegrationUtils.getAdminConnection( service );
@@ -114,11 +105,12 @@ public class DeletePerfIT extends Abstra
         entry.add( "cn", "test" );
         
         connection.add(entry );
-        
+        int nbIterations = 15000;
+
         long t0 = System.currentTimeMillis();
         long tt0 = System.currentTimeMillis();
         
-        for ( int i = 0; i < 5000; i++ )
+        for ( int i = 0; i < nbIterations; i++ )
         {
             if ( i% 1000 == 0 )
             {
@@ -142,17 +134,25 @@ public class DeletePerfIT extends Abstra
         System.out.println( "Delta addition : " + ( t1 - t0 ) );
         
         // Deletion
+
         t0 = System.currentTimeMillis();
+        long t00 = 0L;
         tt0 = System.currentTimeMillis();
         
-        for ( int i = 0; i < 5000; i++ )
+        for ( int i = 0; i < nbIterations; i++ )
         {
-            if ( i% 1000 == 0 )
+            if ( i % 100 == 0 )
             {
                 long tt1 = System.currentTimeMillis();
+
                 System.out.println( i + ", " + ( tt1 - tt0 ) );
                 tt0 = tt1;
             }
+
+            if ( i == 5000 )
+            {
+                t00 = System.currentTimeMillis();
+            }
             
             String name = "test" + i;
             dn = new DN( "cn=" + name + ",dc=example,dc=com" );
@@ -161,8 +161,9 @@ public class DeletePerfIT extends Abstra
         }
         
         t1 = System.currentTimeMillis();
-        
-        System.out.println( "Delta delete : " + ( t1 - t0 ) );
+
+        Long deltaWarmed = ( t1 - t00 );
+        System.out.println( "Delta deletion: " + deltaWarmed + "( " + ( ( ( nbIterations
- 5000 ) * 1000 ) / deltaWarmed ) + " per s ) /" + ( t1 - t0 ) );
 
         connection.close();
     }

Modified: directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/operations/lookup/LookupPerfIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/operations/lookup/LookupPerfIT.java?rev=952477&r1=952476&r2=952477&view=diff
==============================================================================
--- directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/operations/lookup/LookupPerfIT.java
(original)
+++ directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/operations/lookup/LookupPerfIT.java
Mon Jun  7 23:02:10 2010
@@ -62,21 +62,34 @@ public class LookupPerfIT extends Abstra
         
         assertNotNull( entry );
 
+        int nbIterations = 150000;
+
         long t0 = System.currentTimeMillis();
-        
-        for ( int i = 0; i < 100; i++ )
+        long t00 = 0L;
+        long tt0 = System.currentTimeMillis();
+
+        for ( int i = 0; i < nbIterations; i++ )
         {
-            for ( int j = 0; j < 5000; j++ )
+            if ( i % 1000 == 0 )
+            {
+                long tt1 = System.currentTimeMillis();
+
+                System.out.println( i + ", " + ( tt1 - tt0 ) );
+                tt0 = tt1;
+            }
+
+            if ( i == 5000 )
             {
-                connection.lookup( "uid=admin,ou=system", "+" );
+                t00 = System.currentTimeMillis();
             }
-            
-            System.out.print( "." );
+
+            connection.lookup( "uid=admin,ou=system", "+" );
         }
         
         long t1 = System.currentTimeMillis();
-        
-        System.out.println( "Delta : " + ( t1 - t0 ) );
+
+        Long deltaWarmed = ( t1 - t00 );
+        System.out.println( "Delta : " + deltaWarmed + "( " + ( ( ( nbIterations - 5000 )
* 1000 ) / deltaWarmed ) + " per s ) /" + ( t1 - t0 ) );
         connection.close();
     }
 }

Modified: directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/operations/modify/ModifyPerfIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/operations/modify/ModifyPerfIT.java?rev=952477&r1=952476&r2=952477&view=diff
==============================================================================
--- directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/operations/modify/ModifyPerfIT.java
(original)
+++ directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/operations/modify/ModifyPerfIT.java
Mon Jun  7 23:02:10 2010
@@ -74,11 +74,13 @@ public class ModifyPerfIT extends Abstra
 
         connection.add( entry );
 
+        int nbIterations = 150000;
+
         long t0 = System.currentTimeMillis();
         long t00 = 0L;
         long tt0 = System.currentTimeMillis();
 
-        for ( int i = 0; i < 1; i++ )
+        for ( int i = 0; i < nbIterations; i++ )
         {
             if ( i % 100 == 0 )
             {
@@ -88,7 +90,7 @@ public class ModifyPerfIT extends Abstra
                 tt0 = tt1;
             }
 
-            if ( i == 10000 )
+            if ( i == 5000 )
             {
                 t00 = System.currentTimeMillis();
             }
@@ -111,7 +113,8 @@ public class ModifyPerfIT extends Abstra
 
         long t1 = System.currentTimeMillis();
 
-        System.out.println( "Delta : " + ( t1 - t00 ) + "/" + ( t1 - t0 ) );
+        Long deltaWarmed = ( t1 - t00 );
+        System.out.println( "Delta : " + deltaWarmed + "( " + ( ( ( nbIterations - 5000 )
* 1000 ) / deltaWarmed ) + " per s ) /" + ( t1 - t0 ) );
         connection.close();
     }
 }

Modified: directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/operations/search/SearchPerfIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/operations/search/SearchPerfIT.java?rev=952477&r1=952476&r2=952477&view=diff
==============================================================================
--- directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/operations/search/SearchPerfIT.java
(original)
+++ directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/operations/search/SearchPerfIT.java
Mon Jun  7 23:02:10 2010
@@ -64,19 +64,25 @@ public class SearchPerfIT extends Abstra
 
        assertEquals( 1, i );
 
-       for ( int j = 0; j < 10000; j++ )
-       {
-           cursor = connection.search( "uid=admin,ou=system", "(ObjectClass=*)", SearchScope.OBJECT,
"*" );
-           cursor.close();
-       }
+       int nbIterations = 150000;
 
        long t0 = System.currentTimeMillis();
+       long t00 = 0L;
+       long tt0 = System.currentTimeMillis();
        
-       for ( int j = 0; j < 1000000; j++ )
+       for ( i = 0; i < nbIterations; i++ )
        {
-           if ( j % 10000 == 0 )
+           if ( i % 1000 == 0 )
+           {
+               long tt1 = System.currentTimeMillis();
+
+               System.out.println( i + ", " + ( tt1 - tt0 ) );
+               tt0 = tt1;
+           }
+
+           if ( i == 5000 )
            {
-               System.out.println(j);
+               t00 = System.currentTimeMillis();
            }
            
            cursor = connection.search( "uid=admin,ou=system", "(ObjectClass=*)", SearchScope.OBJECT,
"*" );
@@ -84,8 +90,9 @@ public class SearchPerfIT extends Abstra
        }
        
        long t1 = System.currentTimeMillis();
-       
-       System.out.println( "Delta = " + ( t1 - t0 ) );
+
+       Long deltaWarmed = ( t1 - t00 );
+       System.out.println( "Delta : " + deltaWarmed + "( " + ( ( ( nbIterations - 5000 )
* 1000 ) / deltaWarmed ) + " per s ) /" + ( t1 - t0 ) );
        connection.close();
    }
 }



Mime
View raw message