From: Benjamin J. <Ben...@Re...> - 2000-07-27 15:05:31
|
Luke Kanies wrote: > 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. Those numbers are really bad. Searches do not take anywhere near that long for me unless I am searching on an unindexed attribute. I have a script that dumps the uid, givenname, and sn for groups (see attached). It dumps a group with 1056 members in 44.72 seconds. There is a total of 1057 searches run in that time. They are very specific searches, so the LDAP server doesn't need to do much work for them. The output was dumped to the screen, so the IO was also slowing the script down. I have another script that dumps an ldap search as a CSV file. Using a simple search it is able to dump 264 records with 15 attributes each in 4.86 seconds. Moving to a callback cut the time that these searches took in half and the memory usage now stays constant. Without the callback the memory usage went to about 100 times what it now uses when I dumped my entire tree. Both of these times are for the entire script run, including perl loading, IO, ldap searches, etc. This is on a Red Hat 6.1 machine with a 266 MHz PII. When I first looked at this module I had a problem with the startup time for loading scripts being on the order of 30 seconds. That was due to an interaction between the module and a messed up perl install one one machine only. That was with a really old version of Net::LDAP. Upgrading Net::LDAP fixed the problem on that machine. My advise would be to make sure you have a recent version of Net::LDAP, and check your perl install. You may also need to use callbacks to get better results. Ben |