[issue29295] dict: Optimize PyDict_GetItemString()

2017-01-17 Thread STINNER Victor
STINNER Victor added the comment: > Close this issue for now, until profiler shows me PyDict_XString. I like Serhiy's rationale. We should try to avoid PyDict_GetItemString() wheneve possible. If PyDict_GetItemString() becomes a clear bottleneck, we can discuss again optimizing it. But in

[issue29295] dict: Optimize PyDict_GetItemString()

2017-01-17 Thread INADA Naoki
INADA Naoki added the comment: Close this issue for now, until profiler shows me PyDict_XString. -- resolution: -> rejected status: open -> closed ___ Python tracker ___ ___

[issue29295] dict: Optimize PyDict_GetItemString()

2017-01-17 Thread INADA Naoki
INADA Naoki added the comment: This patch checks passed C string is ascii or not. But I don't want make dict complex too. telco is more faster with issue29296. Most common builtin functions are not METH_KEYWORDS when it merged. -- ___ Python tracker

[issue29295] dict: Optimize PyDict_GetItemString()

2017-01-17 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: It looks to me that PyDict_GetItemString(), PyObject_GetAttrString(), etc are mainly for backward compatibility and for using in performance non-critical code. Performance critical code caches string objects. The only code that heavily used PyDict_GetItemStr

[issue29295] dict: Optimize PyDict_GetItemString()

2017-01-17 Thread INADA Naoki
New submission from INADA Naoki: PyDict_GetItemString() is heavily used, especially from keyword argument parsing. Current implementation creates temporary string for key object. This patch avoid the temporary key string when passed C string is ASCII. This benchmark is based on a8563ef0eb8a, so