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.

classification
Title: imaplib.IMAP4_SSL: changed quadratic read() code to linear
Type: Stage:
Components: Library (Lib) Versions:
process
Status: closed Resolution: accepted
Dependencies: Superseder:
Assigned To: pierslauder Nosy List: c_wraith, pierslauder, tinolange
Priority: normal Keywords: patch

Created on 2004-05-19 01:15 by c_wraith, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
patch.txt c_wraith, 2004-05-19 01:15 imaplib patch
Messages (4)
msg45997 - (view) Author: Carl Howells (c_wraith) Date: 2004-05-19 01:15
read() in imaplib.IMAP4_SSL used string concatenation
with += in a loop.  This lead to exceptionally poor
performance retreiving large email messages.

Changed both read() and readline() in IMAP4_SSL to
aggregate string fragments in a list, then join the
elements of the list before returning them.  This
replaces an O(n^2) algorithm with an O(n) algorithm,
for a significant speed increase when retreiving large
email messages.
msg45998 - (view) Author: Piers Lauder (pierslauder) * (Python triager) Date: 2004-05-20 00:50
Logged In: YES 
user_id=196212

Thanks for your changes - will check them in!
msg45999 - (view) Author: Piers Lauder (pierslauder) * (Python triager) Date: 2004-05-20 01:17
Logged In: YES 
user_id=196212

changes checked in.
msg46000 - (view) Author: Tino Lange (tinolange) Date: 2004-07-11 21:05
Logged In: YES 
user_id=212920

cool idea, Carl! This is code to remember!
Thanks for submitting that!
History
Date User Action Args
2022-04-11 14:56:04adminsetgithub: 40268
2004-05-19 01:15:23c_wraithcreate