This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Title: Imaplib speedup patch
Type: performance Stage: patch review
Components: Library (Lib) Versions: Python 3.3
Status: closed Resolution: out of date
Dependencies: Superseder:
Assigned To: Nosy List: aaronkaplan, jafo, pierslauder, pitrou, sandro.tosi
Priority: normal Keywords: patch

Created on 2008-03-03 21:42 by aaronkaplan, last changed 2022-04-11 14:56 by admin. This issue is now closed.

File name Uploaded Description Edit
imaplib-patch aaronkaplan, 2008-03-03 21:42
Messages (5)
msg63237 - (view) Author: Aaron Kaplan (aaronkaplan) Date: 2008-03-03 21:42
In some versions of John Goergen's program offlineimap, he includes a
copy of with the attached changes.  It results in a speedup
of more than 50% compared to using the stock
msg64151 - (view) Author: Sean Reifschneider (jafo) * (Python committer) Date: 2008-03-20 05:01
This patch buffers data inside imaplib, so if anything else wants to use
the socket it may generate surprises.  Piers?
msg128244 - (view) Author: Sandro Tosi (sandro.tosi) * (Python committer) Date: 2011-02-09 22:33
Sean, could you please explain a bit more what are your concerns about this patch?

Anyhow, the code has slightly changed and currently John is not maintaining offlineimap anymore, but what seems the most recent version can be found at:
msg128284 - (view) Author: Aaron Kaplan (aaronkaplan) Date: 2011-02-10 12:14
Let me clarify. Offlineimap used to ship a modified version of imaplib in its distribution, but eventually the author decided he no longer wanted to maintain his imaplib fork, so he dropped it and went with stock imaplib (at a significant performance penalty). The patch I submitted here is the difference between the forked imaplib circa 2007 and the upstream version it was forked from.  The current version of offlineimap is not relevant to this issue, because it no longer contains any imaplib code.
msg128342 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2011-02-10 21:58
The part which is replaced by that patch (the readline() method in IMAP4_SSL) doesn't exist anymore in current imaplib code. Instead the file-like object created by socket.makefile() is used; its readline() method is probably quite faster than any pure Python implementation.
Date User Action Args
2022-04-11 14:56:31adminsetgithub: 46481
2011-02-10 21:58:21pitrousetstatus: open -> closed

assignee: pierslauder ->
versions: + Python 3.3, - Python 2.7
nosy: + pitrou

messages: + msg128342
resolution: out of date
2011-02-10 12:14:40aaronkaplansetnosy: jafo, pierslauder, aaronkaplan, sandro.tosi
messages: + msg128284
2011-02-09 22:33:33sandro.tosisetnosy: + sandro.tosi

messages: + msg128244
stage: patch review
2010-04-06 09:10:32techtoniksetnosy: jafo, pierslauder, aaronkaplan
type: resource usage -> performance
components: + Library (Lib)
versions: + Python 2.7
2008-03-20 05:01:20jafosetpriority: normal
assignee: pierslauder
messages: + msg64151
keywords: + patch
nosy: + jafo
2008-03-03 22:04:46benjamin.petersonsetnosy: + pierslauder
2008-03-03 21:42:06aaronkaplancreate