Message161301
Charmap decoders are not as important as UTF decoders, but are still widely used. In Python 3.3 with PEP 393 they slowed down 4x. The proposed patch restores the performance.
Optimized only the most common case, when the decoder is specified by the UCS2 table with length >= 256. Map-based decoders translated to table-based. UCS1 tables widened to UCS2 by adding 257th fake characters.
Benchmark results:
3.2 3.3(vanilla) 3.3(patched)
cp1251 'A'*10000 111 (+10%) 31 (+294%) 122
cp1251 '\xa0'*10000 111 (+8%) 29 (+314%) 120
cp1251 '\u0402'*10000 111 (+6%) 25 (+372%) 118 |
|
Date |
User |
Action |
Args |
2012-05-21 22:19:32 | serhiy.storchaka | set | recipients:
+ serhiy.storchaka, lemburg, pitrou, vstinner, ezio.melotti |
2012-05-21 22:19:30 | serhiy.storchaka | set | messageid: <1337638770.26.0.783937266614.issue14874@psf.upfronthosting.co.za> |
2012-05-21 22:19:29 | serhiy.storchaka | link | issue14874 messages |
2012-05-21 22:19:29 | serhiy.storchaka | create | |
|