| Newsgroups |
php.pear.bugs |
| Message-ID |
<[email protected]> |
Edit report at http://pear.php.net/bugs/bug.php?id=18752&edit=1
ID: 18752
Comment by: [email protected]
Reported By: xavier dot montagutelli at unilim dot fr
Summary: Performance problem retrieving search result + patch
Status: Verified
Type: Feature/Change Request
Package: Net_LDAP2
Operating System: GNU/Linux Debian
Package Version: 2.0.11
PHP Version: 5.3.0
Assigned To: beni
Roadmap Versions:
New Comment:
Your patch is not correct, it misses the underscore in the
"count_entries" variable.
Once corrected with the patch missingUnderscoreForCountCache, it works
better. Here are the numbers :
# php liste-net-ldap2.php
1. Using PHP native LDAP functions
Number of entries : 22407
Search time : 2 seconds
Building list from search result : 0 seconds
2. Using Net_LDAP2 object
Number of entries : 22407
Search time : 2 seconds
Building list from search result : 8 seconds
Net_LDAP2 is always much slower than the native LDAP functions, but we
have reduced the difference (from 15 s to 8 s).
But, why do you want to maintain the call to the "count" method at the
beginning of "shiftEntry" ? My first patch could be improved by testing
the result of ldap_first_entry to get rid of this call. If there are no
result, it returns false. So the call to "count" is useless.
Both patches could be inserted, as they serve different purposes in
fact.
Previous Comments:
------------------------------------------------------------------------
[2011-08-24 13:51:19] montagut
Added #patch
bug:18752;patch:missingUnderscoreForCountCache;revision:1314190279;.
------------------------------------------------------------------------
[2011-08-24 08:42:12] beni
Its in SVN now. Please test.
------------------------------------------------------------------------
[2011-08-24 07:48:29] beni
Added #patch
bug:18752;patch:Search.php_addCountCache.patch;revision:1314168509;.
------------------------------------------------------------------------
[2011-08-24 07:46:07] beni
ok, it looks like the pear svn is down currently, so the fix is not in.
i will add it as patch un til i can commit the change.
------------------------------------------------------------------------
[2011-08-24 07:45:26] beni
Confirmed this.
However this would involve an API change.
The better way is surely to cache the call to ldap_count_entries and
return the count from that cache.
I added a fix to count(). Please fetch the latest SVN version (revision
xxx) and verify that your bug is solved now.
Thanks for improving Net_LDAP2!
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
http://pear.php.net/bugs/bug.php?id=18752
--
Edit this bug report at http://pear.php.net/bugs/bug.php?id=18752&edit=1