[New-bugs-announce] [issue19512] Avoid most calls to PyUnicode_DecodeUTF8Stateful() in Python interactive mode

STINNER Victor report at bugs.python.org
Wed Nov 6 18:05:05 CET 2013


New submission from STINNER Victor:

In interactive mode, when I run python in gdb, I see that PyUnicode_DecodeUTF8Stateful() is called a lot of times. Calls come from PyDict_GetItemString() or PySys_GetObject() for example.

Allocating a temporary Unicode string and decode a byte string from UTF-8 is inefficient: the memory allocator is stressed and the byte string is decoded at each call.

I propose to reuse the _Py_IDENTIFIER API in most common places to limit calls to the memory allocator and to PyUnicode_DecodeUTF8Stateful().

----------
messages: 202273
nosy: haypo
priority: normal
severity: normal
status: open
title: Avoid most calls to PyUnicode_DecodeUTF8Stateful() in Python interactive mode
versions: Python 3.4

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue19512>
_______________________________________


More information about the New-bugs-announce mailing list