From: Dave A. <da...@bo...> - 2012-11-13 20:06:34
|
Check it out. The first run is with imaplib2, the second with imaplib. --8<---------------cut here---------------start------------->8--- pluto:~ dave% time python -c 'from imaplib2 import *; s = IMAP4_stream("/opt/local/libexec/dovecot/imap"); s.open(); s.select("INBOX")' imap(dave): Info: Connection closed in=20 out=721 imap(dave): Info: Connection closed in=18 out=694 python -c 0.04s user 0.02s system 0% cpu 30.159 total pluto:~ dave% time python -c 'from imaplib import *; s = IMAP4_stream("/opt/local/libexec/dovecot/imap"); s.open(); s.select("INBOX")' imap(dave): Info: Connection closed in=20 out=721 imap(dave): Info: Connection closed in=18 out=694 python -c 0.04s user 0.02s system 64% cpu 0.086 total --8<---------------cut here---------------end--------------->8--- If I don't try to open(), it goes fast: --8<---------------cut here---------------start------------->8--- pluto:~ dave% time python -c 'from imaplib2 import *; print IMAP4_stream("/opt/local/libexec/dovecot/imap").select("INBOX")' ('OK', ['44']) imap(dave): Info: Connection closed in=38 out=1070 python -c 0.04s user 0.02s system 34% cpu 0.161 total --8<---------------cut here---------------end--------------->8--- -- Dave Abrahams BoostPro Computing Software Development Training http://www.boostpro.com Clang/LLVM/EDG Compilers C++ Boost |