Message173695
Attached patch modifies text decoders to use the _PyUnicodeWriter API to factorize the code. It removes unicode_widen() and unicode_putchar() functions.
* Don't overallocate by default (except for "raw-unicode-escape" codec), enable overallocation on the first decode error (as done currently)
* _PyUnicodeWriter_Prepare() only overallocates 25%, instead of 100%
for unicode_decode_call_errorhandler()
* Use _PyUnicodeWriter_Prepare() + PyUnicode_WRITE() (two macros)
instead of unicode_putchar() (function)
* _PyUnicodeWriter structures stores many useful fields, so we don't
have to pass multiple parameters to functions, only the writer
I wrote the patch to factorize the code, but it might be faster. |
|
Date |
User |
Action |
Args |
2012-10-24 18:38:22 | vstinner | set | recipients:
+ vstinner |
2012-10-24 18:38:21 | vstinner | set | messageid: <1351103901.39.0.0945105753188.issue16311@psf.upfronthosting.co.za> |
2012-10-24 18:38:21 | vstinner | link | issue16311 messages |
2012-10-24 18:38:21 | vstinner | create | |
|