[phpldapadmin] [ phpldapadmin-Bugs-3391046 ] Loading entries with many attributes is very slow

SourceForge.net <[email protected]> Sat, 10 Sep 2011 19:26:52 +0200
Newsgroups gmane.comp.ldap.davedap
Message-ID <[email protected]>
Bugs item #3391046, was opened at 2011-08-13 20:36
Message generated for change (Comment added) made by gruberroland
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=498546&aid=3391046&group_id=61828

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: None
Group: None
>Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Roland Gruber (gruberroland)
Assigned to: Nobody/Anonymous (nobody)
Summary: Loading entries with many attributes is very slow

Initial Comment:
Hi Deon,

opening an LDAP entry that has lots of attributes (about 100) takes about 10 seconds on a recent PC. The problem is the sorting.
PLA calls Attribute->getName() and real_attr_name() several 100,000 times. This is caused by ~100,000 calls of getFriendlyName().

The source seems to be in sortAttrs($a,$b) that does not use cached values. Probably, it would be even better to simply get a list of all attribute friendly names first and then do a simple sorting on them (and no usort at all).

Unfortunately, I do not know enough about the code to provide a patch. I hope that my explanations help you to fix this.


Best regards

Roland

----------------------------------------------------------------------

>Comment By: Roland Gruber (gruberroland)
Date: 2011-09-10 19:26

Message:
Exactly, it is the number of attributes and not the number of entries.
The problem is the sorting.

----------------------------------------------------------------------

Comment By: Adam Thompson (athompso)
Date: 2011-09-08 17:21

Message:
I don't have as extreme a case as Roland, but I've also noticed this.  Not
the # of LDAP entries in a container, but the number of distinct key/value
pairs (attributes) on a single LDAP entry makes opening that specific DN
quite slow.  My server is sometimes CPU-starved, and I can see the
difference between a DN with ~20 attrs and ~100 attrs at that time.

----------------------------------------------------------------------

Comment By: Deon George (wurley)
Date: 2011-09-08 14:45

Message:
Hi Roland,

I'm not sure I follow you? On my test server (the demo site), I have a few
branches with 1000+ entries, and it takes about 3 seconds for me (to expand
a branch on the tree)... Is this the scenario you are talking about?

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=498546&aid=3391046&group_id=61828

------------------------------------------------------------------------------
Malware Security Report: Protecting Your Business, Customers, and the 
Bottom Line. Protect your business and customers by understanding the 
threat from malware and how it can impact your online business. 
http://www.accelacomm.com/jaw/sfnl/114/51427462/
______________________________________
phpLDAPadmin development mailing list.
To unsbuscribe: https://lists.sourceforge.net/lists/listinfo/phpldapadmin-devel
http://phpldapadmin.sourceforge.net/