> ext Sagar R. Shah ([EMAIL PROTECTED]) wrote: >> >> I decided to investigate further and profiled a script that obtained all >> the LDAP attributes for a specific userid 500 times. Here's the profiler >> output: >> >> $ dprofpp tmon.out >> Total Elapsed Time = 27.01739 Seconds >> User+System Time = 20.43654 Seconds >> Exclusive Times >> %Time ExclSec CumulS #Calls sec/call Csec/c Name >> 27.7 5.668 55.339 13503 0.0004 0.0041 Convert::ASN1::_decode >> 24.6 5.046 4.818 29009 0.0002 0.0002 Convert::ASN1::_decode_tl >> 6.94 1.418 44.101 12502 0.0001 0.0035 > >> Convert::ASN1 - or at least the way Net::LDAP uses Convert::ASN1 >> seems to >> be the "problem". > > Convert::ASN1 was written by Graham, for the specific purpose of allowing > Net::LDAP to be a "pure perl" module, afaik. Correct me if I'm off track > here. > > The pure perl ASN.1 converter is very slow, as you have seen, but it is > really useful in many cases. > > For all applications, you have to decide what is the appropriate language > to > use based on your performance needs, etc. If you are regularly querying > 10k > entries for mailing list traffic, then of course it makes sense to code > this > functionality in C.
Why does it 'make sense' to deviate from pure perl? I'm not disputing that doing it in C would probably be faster, but you seem to be implying that there are not enough pure perl optimisations that can be done to get a comprarable speed-up. I don't know enough about Convert::ASN1 to say whether such optimisations exist or not, hence my original query about what could be done. At no point did I suggest that Net::LDAP should stop being pure perl. Are you pretty certain that pure-perl optimisations/changes cannot get a comparible speedup? If you are then fair enough - but perhaps the Net::LDAP FAQ should make a mention of the module's limitations. > I find that for 9 out of 10 cases, Net::LDAP performance > is good enough. Ditto :) Out of interest, do you use another module in the other 10% of cases? Or just take the performance hit? Thanks for taking the time to respond to my original mail.