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 <1368450401.98.0.77122764886.issue5803@psf.upfronthosting.co.za>
In-reply-to
Content
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/decimal.py').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.
History
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: <1368450401.98.0.77122764886.issue5803@psf.upfronthosting.co.za>
2013-05-13 13:06:41serhiy.storchakalinkissue5803 messages
2013-05-13 13:06:41serhiy.storchakacreate