You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by el...@apache.org on 2010/06/06 23:20:59 UTC
svn commit: r951979 - in /directory/apacheds/trunk:
core-api/src/main/java/org/apache/directory/server/core/interceptor/
core-integ/src/test/java/org/apache/directory/server/core/operations/list/
Author: elecharny
Date: Sun Jun 6 21:20:58 2010
New Revision: 951979
URL: http://svn.apache.org/viewvc?rev=951979&view=rev
Log:
o Added a perf test for the List operation
o Removed the eagerlyPopulateFields for this operation
Added:
directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/operations/list/
directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/operations/list/ListPerfTest.java
Modified:
directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/interceptor/InterceptorChain.java
Modified: directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/interceptor/InterceptorChain.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/interceptor/InterceptorChain.java?rev=951979&r1=951978&r2=951979&view=diff
==============================================================================
--- directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/interceptor/InterceptorChain.java (original)
+++ directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/interceptor/InterceptorChain.java Sun Jun 6 21:20:58 2010
@@ -691,7 +691,6 @@ public class InterceptorChain
Element entry = getStartingEntry();
Interceptor head = entry.interceptor;
NextInterceptor next = entry.nextInterceptor;
- eagerlyPopulateFields( opContext );
try
{
Added: directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/operations/list/ListPerfTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/operations/list/ListPerfTest.java?rev=951979&view=auto
==============================================================================
--- directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/operations/list/ListPerfTest.java (added)
+++ directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/operations/list/ListPerfTest.java Sun Jun 6 21:20:58 2010
@@ -0,0 +1,97 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+package org.apache.directory.server.core.operations.list;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+
+import org.apache.directory.server.core.filtering.EntryFilteringCursor;
+import org.apache.directory.server.core.integ.AbstractLdapTestUnit;
+import org.apache.directory.server.core.integ.FrameworkRunner;
+import org.apache.directory.server.core.interceptor.context.ListOperationContext;
+import org.apache.directory.shared.ldap.entry.Entry;
+import org.apache.directory.shared.ldap.name.DN;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+
+/**
+ * Test the List operation
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev$
+ */
+@RunWith ( FrameworkRunner.class )
+public class ListPerfTest extends AbstractLdapTestUnit
+{
+ /**
+ * A List performance test
+ */
+ @Test
+ public void testPerfList() throws Exception
+ {
+ ListOperationContext opContext = new ListOperationContext( service.getAdminSession(), new DN( "ou=system" ) );
+ EntryFilteringCursor cursor = service.getOperationManager().list( opContext );
+
+ assertNotNull( cursor );
+ int nb = 0;
+
+ while ( cursor.next() )
+ {
+ Entry entry = cursor.get();
+ nb++;
+
+ assertNotNull( entry );
+ }
+
+ cursor.close();
+
+ assertEquals( 5, nb );
+
+ long t0 = System.currentTimeMillis();
+
+ for ( int i = 0; i < 10; i++ )
+ {
+ for ( int j = 0; j < 5000; j++ )
+ {
+ nb = 0;
+ cursor = service.getOperationManager().list( opContext );
+
+ while ( cursor.next() )
+ {
+ Entry entry = cursor.get();
+ nb++;
+
+ assertNotNull( entry );
+ }
+
+ cursor.close();
+
+ assertEquals( 5, nb );
+ }
+
+ System.out.print( "." );
+ }
+
+ long t1 = System.currentTimeMillis();
+
+ System.out.println( "Delta : " + ( t1 - t0 ) );
+ }
+}