Why does writing STDOUT affect my Python LDAP performance?

Michael Ströder michael at stroeder.com
Tue Feb 12 13:18:05 CET 2002


Leif Hedstrom wrote:
> 
> I wanted to write a very small app to do some simple tests, and I got
> some very, very strange results. I can't understand why the performance
> is so abysmal unless I print on STDOUT... The script is something like:
> [..test script snipped..]

I've added measuring the time to the script itself and can't
reproduce your results (tested with python2.0, python2.1.1 and
python2.2). In my case redirecting stdout to /dev/null was faster.
How did you do time measuring? Maybe somebody screwed up /dev/null
on your system?

BTW:
Remember to use
l.set_option(ldap.OPT_PROTOCOL_VERSION,ldap.VERSION3) to set
protocol version to LDAPv3.

> Also, this simple script leaks memory, not sure where yet.

Hmm, interesting question. Any C hacker with a license of e.g.
Purify willing to dig into this?

Ciao, Michael.




More information about the python-ldap mailing list