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.

Author vstinner
Recipients vstinner
Date 2013-11-06.17:05:05
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1383757505.5.0.780170182234.issue19512@psf.upfronthosting.co.za>
In-reply-to
Content
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().
History
Date User Action Args
2013-11-06 17:05:05vstinnersetrecipients: + vstinner
2013-11-06 17:05:05vstinnersetmessageid: <1383757505.5.0.780170182234.issue19512@psf.upfronthosting.co.za>
2013-11-06 17:05:05vstinnerlinkissue19512 messages
2013-11-06 17:05:05vstinnercreate