]> granicus.if.org Git - python/commit
Issue #29383: reduce temporary interned unicode
authorINADA Naoki <songofacandy@gmail.com>
Sat, 28 Jan 2017 07:35:44 +0000 (16:35 +0900)
committerINADA Naoki <songofacandy@gmail.com>
Sat, 28 Jan 2017 07:35:44 +0000 (16:35 +0900)
commit35a96a25eef03f687f727ae3b243f83937f59aa0
tree3f28ea0f814817f8e5f2e93f8600eaefac7e59b3
parent49688cdaa2a9642681ce57be5312d4aa65c3dc42
Issue #29383: reduce temporary interned unicode

add_methods(), add_members(), and add_getset() used PyDict_SetItemString()
to register descriptor to the type's dict.
So descr_new() and PyDict_SetItemString() creates interned unicode from same
C string.

This patch takes interned unicode from descriptor, and use PyDict_SetItem()
instead of PyDict_SetItemString().

python_startup_no_site:
  default: Median +- std dev: 12.7 ms +- 0.1 ms
  patched: Median +- std dev: 12.5 ms +- 0.1 ms
Objects/typeobject.c