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.
Created on 2015年10月09日 12:13 by vstinner, last changed 2022年04月11日 14:58 by admin. This issue is now closed.
| Files | ||||
|---|---|---|---|---|
| File name | Uploaded | Description | Edit | |
| unicode_escape.patch | vstinner, 2015年10月09日 12:13 | review | ||
| Messages (4) | |||
|---|---|---|---|
| msg252599 - (view) | Author: STINNER Victor (vstinner) * (Python committer) | Date: 2015年10月09日 12:13 | |
Attached patch modifies unicode escape and raw unicode escape encoders to use the new _PyBytesWriter API. The patch is optimized to encode Latin1 characters: encoding Latin1 characters when no character is escaped should not have to call _PyByte_Resize() at all. When characters are escaped or a BMP or non-BMP string is encoded, overallocation is used to reduce the number of _PyByte_Resize(). It uses _PyBytesWriter overallocation strategy instead of always overallocate for the worst case. _PyBytesWriter also embeds a small buffer allocated on the stack which also avoids calls to _PyBytes_Resize() when the output fits into 512 bytes. |
|||
| msg252600 - (view) | Author: STINNER Victor (vstinner) * (Python committer) | Date: 2015年10月09日 12:15 | |
A few more encoders should be updated to use _PyBytesWriter API: * Code Page (Windows only) * Charmap * UTF-7 * UTF-16 * UTF-32 |
|||
| msg252601 - (view) | Author: STINNER Victor (vstinner) * (Python committer) | Date: 2015年10月09日 12:16 | |
The _PyBytesWriter API was added in the issue #25318. See also the issue #25349 which optimized bytes % args. |
|||
| msg252888 - (view) | Author: Roundup Robot (python-dev) (Python triager) | Date: 2015年10月12日 20:39 | |
New changeset 8e27f8398a4f by Victor Stinner in branch 'default': Issue #25353: Optimize unicode escape and raw unicode escape encoders to use https://hg.python.org/cpython/rev/8e27f8398a4f |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022年04月11日 14:58:22 | admin | set | github: 69540 |
| 2015年10月12日 20:41:38 | vstinner | set | status: open -> closed resolution: fixed |
| 2015年10月12日 20:39:28 | python-dev | set | nosy:
+ python-dev messages: + msg252888 |
| 2015年10月09日 12:16:37 | vstinner | set | messages: + msg252601 |
| 2015年10月09日 12:15:27 | vstinner | set | messages: + msg252600 |
| 2015年10月09日 12:13:42 | vstinner | create | |