From: Luke K. <luk...@bl...> - 2000-07-26 23:31:40
|
Hi all. I have some questions about perceived speed of Net::LDAP. I ran some quick comparisons between it and the command line, and am willing to do more if anyone wants more info. My problem is that Net::LDAP appears to be about an order of magnitude slower for search operations than the corresponding command line function. For instance, I have an ldap database with 1768 ou's in it, and I performed three different types of searches on it using both the command line and Net::LDAP. First I just dumped all of the entries to the screen; then I built a hash of all of the entries, of the form $hash{$dn}->{$attr} = $value. Finally, I did another search and just counted the entries. For the command line functions, to dump to screen I just used system(), to build the hash, I used open() and then match and split, and to count I used open() and counted blank lines. For Net::LDAP, to dump I did the search and cycled through the entries with $entry->dump, to build the hash, I cycled through and used: $dn = $entry->dn; foreach $attr ($entry->attributes) { $hash{$dn}->{$attr} = $entry->get($attr); } and for counting, I just did a $count++ for each entry. For each Net::LDAP search I opened and closed the connection for each time test. Here are the numbers that I found: Net: dump 21 Net: hash 14 Net: count 16 CLI: dump 2 CLI: hash 1 CLI: count 1 As you can see, Net::LDAP performed pretty abysmally. My question is, does everyone else see this too, and is it going to be addressed? If it's not going to be fixed, is Net::LDAPapi or Mozilla::LDAP any better? I really can't afford 20 seconds for all of my searches, so if Net::LDAP is going to take that long, I can't use it. And I want to avoid the command line if possible, since I don't like the idea of running long searches using the user's password on the command line. If anyone is interested, I can send my code, or I can run more tests. I really would like to use Net::LDAP, since it is tons easier to use the Net::LDAPapi, but I can't if it is going to be this slow. Thanks, and please email me if you have any questions about my results. -- Luke A. Kanies | "Most people are born and years later die without System Engineer | really having lived at all. They play it safe and 615/778-7268 | tiptoe through life with no aspiration other than to pgr 800/415-1972| arrive at death safely."-Tony Campolo, "Carpe Diem" |