[issue29383] Reduce temporary unicode object while adding descriptors

2017-01-27 Thread INADA Naoki
Changes by INADA Naoki : -- resolution: -> fixed status: open -> closed ___ Python tracker ___

[issue29383] Reduce temporary unicode object while adding descriptors

2017-01-27 Thread Roundup Robot
Roundup Robot added the comment: New changeset d7ec72c1620c by INADA Naoki in branch 'default': Issue #29383: reduce temporary interned unicode https://hg.python.org/cpython/rev/d7ec72c1620c -- nosy: +python-dev ___ Python tracker

[issue29383] Reduce temporary unicode object while adding descriptors

2017-01-27 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: descr-remove-getitemstring-2.patch LGTM. -- nosy: +serhiy.storchaka ___ Python tracker ___

[issue29383] Reduce temporary unicode object while adding descriptors

2017-01-27 Thread INADA Naoki
Changes by INADA Naoki : Added file: http://bugs.python.org/file46444/dict-setitemstring.patch ___ Python tracker ___

[issue29383] Reduce temporary unicode object while adding descriptors

2017-01-27 Thread INADA Naoki
INADA Naoki added the comment: descr-remove-getitemstring-2.patch is more compact than first patch. (3 unicode + 2 intern) becomes (2 unicode + 1 intern). python_startup_no_site: Median +- std dev: 12.5 ms +- 0.1 ms -- Added file:

[issue29383] Reduce temporary unicode object while adding descriptors

2017-01-27 Thread INADA Naoki
INADA Naoki added the comment: I think I found better way. Interned string can be get from descripter. Interning can be reduced without adding private API. Please don't review the first patch. -- ___ Python tracker

[issue29383] Reduce temporary unicode object while adding descriptors

2017-01-27 Thread INADA Naoki
New submission from INADA Naoki: add_methods(), add_members(), and add_getset() creates PyUnicode from C string 3 times, and calls PyUnicode_InternInplace 2 times. 1. PyDict_GetItemString() at first. (PyUnicode_FromString() is called). 2. In middle, descr_new() calls