From: Chris R. <chr...@me...> - 2001-06-19 08:13:06
|
fh...@ts... wrote: > faster. Net::LDAP outperformed PerLDAP. In the case of multiple entries > though, the native methods were slower in both Net::LDAP and Mozilla. It's interesting that pure perl is beating the mixed C & perl of perLDAP. I don't know what these "native methods" are - are you calling something like the ldapsearch program? More to the point, are you calling something that talks (LDAP) protocol to get to the directory, or something that reads from the databases directly? If you're reading the databases directly then there's nothing that is going to beat that, but if you're using protocol then Net::LDAP stands a chance... > While mod_perl is not an option for me at this time. Are there other ways > to optimize searches which could improve performance? Net::LDAP uses a *lot* of memory when it receives large numbers of search results. This might be slowing Net::LDAP down a lot. One way to avoid this is to set a callback in the search method (ie $ldap->search(..., callback => \&search_result_handler)) and in your sub search_result_handler do something with the search result and arrange for Net::LDAP not to keep hold of it. Something like this: sub search_result_handler { my ($mesg, $e) = @_; if ($e && $e->isa('Net::LDAP::Entry')) { # Do something with the entry in $e $mesg->pop_entry; # See Net::LDAP::Search for details } # Could also get Net::LDAP::Reference objects } Does using callbacks help improve performance at all? > Fred Hirsch > Toronto Stock Exchange > > Cheers, Chris |