Path: csiph.com!usenet.pasdenom.info!aioe.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed5.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.006 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'default.': 0.07; 'python': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'runtime': 0.09; 'terry': 0.09; 'code?': 0.16; 'message-id:@dough.gmane.org': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'reedy': 0.16; 'runtime.': 0.16; 'subject:slow': 0.16; 'wrote:': 0.17; 'exists': 0.17; 'jan': 0.18; 'code.': 0.20; 'issue.': 0.20; 'disabled': 0.22; 'header:In-Reply-To:1': 0.25; 'header:User-Agent:1': 0.26; 'setting': 0.26; 'am,': 0.27; 'header:X-Complaints-To:1': 0.28; 'perl': 0.29; 'selecting': 0.29; 'seconds': 0.30; 'code': 0.31; 'to:addr:python-list': 0.33; 'server': 0.35; 'so,': 0.35; 'there': 0.35; 'received:org': 0.36; 'but': 0.36; 'bad': 0.37; 'ok,': 0.37; 'subject:: ': 0.38; 'performance': 0.39; 'to:addr:python.org': 0.39; 'header:Received:5': 0.40; 'think': 0.40; 'bring': 0.62; 'our': 0.65; 'mailbox': 0.67; 'response.': 0.67; 'difference.': 0.84; 'received:fios.verizon.net': 0.84; 'seconds!': 0.84; 'warrants': 0.84; 'subject:very': 0.91 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Terry Reedy Subject: Re: append in IMAP4 from imaplib very slow Date: Thu, 26 Jul 2012 10:30:11 -0400 References: <5010314F.80001@abusix.com> <5010B7B5.5040206@tim.thechases.com> <5010F689.8090701@abusix.com> <50110D14.7020906@abusix.com> <50113041.4010501@abusix.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Gmane-NNTP-Posting-Host: pool-173-75-251-66.phlapa.fios.verizon.net User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:13.0) Gecko/20120614 Thunderbird/13.0.1 In-Reply-To: <50113041.4010501@abusix.com> X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 24 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1343313046 news.xs4all.nl 6946 [2001:888:2000:d::a6]:55792 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:26091 On 7/26/2012 7:55 AM, Simon Pirschel wrote: > On 07/26/2012 11:25 AM, Simon Pirschel wrote: >> Ok, forget about the EXISTS and RECENT response. The server will >> response this way if you selected a mailbox, which I did in the Python >> code but not in the Perl code. I disabled selecting the mailbox in >> Python and there is no difference in the runtime. So, this isn't the >> issue. > > I solved the issue. The bad performance is caused by the socketopt > socket.TCP_NODELAY set to 0 by default. > > Request timing with socket.TCP_NODELAY=0: 0.0501310825348 seconds > Request timing with socket.TCP_NODELAY=1: 0.0027711391449 seconds > > This is a huge difference. Setting TCP_NODELAY=1 will bring the runtime > from 3:30 minutes down to 14 seconds! Not Perl speed, but close. Do you think this warrants a change in our docs, if not the code? -- Terry Jan Reedy