[issue31187] suboptimal code in Py_ReprEnter()

2017-08-17 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- resolution: -> rejected stage: -> resolved status: open -> closed ___ Python tracker ___ ___ Python

[issue31187] suboptimal code in Py_ReprEnter()

2017-08-13 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: PyList_GET_SIZE(list) is cheap (especially in comparison of _PyDict_GetItemId(), _PyDict_SetItemId() and PyList_New()), and its tiny overhead can be avoided at most once per thread's lifetime. I'm sure you can't measure the effect of this change. If surroun

[issue31187] suboptimal code in Py_ReprEnter()

2017-08-12 Thread Oren Milman
New submission from Oren Milman: in Objects/object.c, Py_ReprEnter() does the following: - try to retrieve the Py_Repr list from the thread-state dict. - in case the list is not in the dict, add it to the dict as an empty list. - check whether the received object is in the Py_Repr lis