Issue Details (XML | Word | Printable)

Key: DIRSERVER-652
Type: Improvement Improvement
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Unassigned
Reporter: Emmanuel Lecharny
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Directory ApacheDS

Avoid multiple creation of LdapDN

Created: 24/Jun/06 03:32 PM   Updated: 23/Aug/06 12:33 PM
Return to search
Component/s: None
Affects Version/s: 1.0-RC3
Fix Version/s: 1.0-RC4

Time Tracking:
Not Specified

Resolution Date: 23/Aug/06 12:33 PM


 Description  « Hide
After having profiled the server, I found that the LdapDN<init>(Name) has been called 3000 times, because the LdapPrincipal contains a Name instead of a LdapDN element.

We should check that the passed Name is not an instance of LdapDN before calling new LdapDN( Name) in
org.apache.directory.server.core.authz.DefaultAuthorizationService.protectLookUp() method
 :
...
LdapDN principalDn = new LdapDN( ( ( ServerContext ) ctx ).getPrincipal().getJndiName() );
...

could be :
Name name = ( ( ServerContext ) ctx ).getPrincipal().getJndiName() ;

LdapDN principalDn= ( name instanceof LdapDN ? name.clone() : new LdapDN( name ) );
    

 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Emmanuel Lecharny added a comment - 24/Jun/06 11:13 PM
I evaluate the gain in performance for search operations to 3,7%. (tests done with a server containing 10000 entries and doing a random search)

Emmanuel Lecharny added a comment - 23/Aug/06 12:33 PM
We have removed all unecessary DN parsing, so we can close this issue

Emmanuel Lecharny added a comment - 23/Aug/06 12:33 PM
Work has been done two months ago.