Message189126
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. |
|
Date |
User |
Action |
Args |
2013-05-13 13:06:42 | serhiy.storchaka | set | recipients:
+ serhiy.storchaka, barry, pitrou, dmbaggett, r.david.murray, cainmatt |
2013-05-13 13:06:41 | serhiy.storchaka | set | messageid: <1368450401.98.0.77122764886.issue5803@psf.upfronthosting.co.za> |
2013-05-13 13:06:41 | serhiy.storchaka | link | issue5803 messages |
2013-05-13 13:06:41 | serhiy.storchaka | create | |
|