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.

Author serhiy.storchaka
Recipients barry, cainmatt, dmbaggett, pitrou, r.david.murray, serhiy.storchaka
Date 2013-05-13.13:06:40
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
Here is a patch for 3.4 based on Matt's patch with additional optimizations. It speeds up body_encode() and header_encode().

$ ./python -m timeit -s "from email.quoprimime import body_encode as encode; x = open('Lib/').read()[:100000]"  "encode(x)"

Before patch: 1.12 sec per loop
After patch: 26.3 msec per loop

$ ./python -m timeit -s "from email.quoprimime import header_encode as encode; x = b'A'*100"  "encode(x)"

Before patch: 97.9 usec per loop
After patch: 23.7 usec per loop

For non-ascii data difference is even larger.
Date User Action Args
2013-05-13 13:06:42serhiy.storchakasetrecipients: + serhiy.storchaka, barry, pitrou, dmbaggett, r.david.murray, cainmatt
2013-05-13 13:06:41serhiy.storchakasetmessageid: <>
2013-05-13 13:06:41serhiy.storchakalinkissue5803 messages
2013-05-13 13:06:41serhiy.storchakacreate