Return-Path: Delivered-To: apmail-directory-commits-archive@www.apache.org Received: (qmail 22687 invoked from network); 29 Aug 2005 06:27:27 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 29 Aug 2005 06:27:27 -0000 Received: (qmail 15744 invoked by uid 500); 29 Aug 2005 06:27:26 -0000 Delivered-To: apmail-directory-commits-archive@directory.apache.org Received: (qmail 15720 invoked by uid 500); 29 Aug 2005 06:27:26 -0000 Mailing-List: contact commits-help@directory.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@directory.apache.org Delivered-To: mailing list commits@directory.apache.org Received: (qmail 15707 invoked by uid 99); 29 Aug 2005 06:27:26 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 28 Aug 2005 23:27:26 -0700 X-ASF-Spam-Status: No, hits=-9.8 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [209.237.227.194] (HELO minotaur.apache.org) (209.237.227.194) by apache.org (qpsmtpd/0.29) with SMTP; Sun, 28 Aug 2005 23:27:42 -0700 Received: (qmail 22639 invoked by uid 65534); 29 Aug 2005 06:27:25 -0000 Message-ID: <20050829062725.22638.qmail@minotaur.apache.org> Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r264090 - /directory/shared/ldap/trunk/common/src/java/org/apache/ldap/common/schema/DnComparator.java Date: Mon, 29 Aug 2005 06:27:25 -0000 To: commits@directory.apache.org From: elecharny@apache.org X-Mailer: svnmailer-1.0.5 X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Author: elecharny Date: Sun Aug 28 23:27:21 2005 New Revision: 264090 URL: http://svn.apache.org/viewcvs?rev=264090&view=rev Log: Add a simple String comparison to greatly improve the ApacheDs performance. Modified: directory/shared/ldap/trunk/common/src/java/org/apache/ldap/common/schema/DnComparator.java Modified: directory/shared/ldap/trunk/common/src/java/org/apache/ldap/common/schema/DnComparator.java URL: http://svn.apache.org/viewcvs/directory/shared/ldap/trunk/common/src/java/org/apache/ldap/common/schema/DnComparator.java?rev=264090&r1=264089&r2=264090&view=diff ============================================================================== --- directory/shared/ldap/trunk/common/src/java/org/apache/ldap/common/schema/DnComparator.java (original) +++ directory/shared/ldap/trunk/common/src/java/org/apache/ldap/common/schema/DnComparator.java Sun Aug 28 23:27:21 2005 @@ -88,15 +88,23 @@ } else if ( obj1 instanceof String ) { - try - { - dn1 = parser.parse( ( String ) obj1 ) ; - } - catch ( NamingException ne ) - { - throw new IllegalArgumentException( - "first argument was not a distinguished name" ) ; - } + // Speedup the comparison + if ( ((String)obj1).compareTo((String)obj2) == 0) + { + return 0; + } + else + { + try + { + dn1 = parser.parse( ( String ) obj1 ) ; + } + catch ( NamingException ne ) + { + throw new IllegalArgumentException( + "first argument was not a distinguished name" ) ; + } + } } else {