[issue33930] Segfault with deep recursion into object().__dir__

INADA Naoki report at bugs.python.org
Fri Nov 30 06:57:26 EST 2018


INADA Naoki <songofacandy at gmail.com> added the comment:

microbench:


$ ./python.patched -m perf timeit --compare-to ./python.master -s 'o="foo"' 'o.encode'
python.master: ..................... 29.3 ns +- 0.6 ns
python.patched: ..................... 30.9 ns +- 1.3 ns

Mean +- std dev: [python.master] 29.3 ns +- 0.6 ns -> [python.patched] 30.9 ns +- 1.3 ns: 1.05x slower (+5%)



And this is perf report of python.patched:


  33.17%   _PyEval_EvalFrameDefault
  15.25%   _PyObject_GenericGetAttrWithDict
   9.63%   PyCFunction_NewEx
   8.25%   _PyType_Lookup
   6.42%   meth_dealloc
   3.50%   _Py_bytes_contains
   3.22%   PyObject_GC_UnTrack
   3.20%   method_get
   2.73%   PyObject_GetAttr
   2.55%   repeat_next
   0.88%   _Py_Dealloc
   0.81%   PyObject_GenericGetAttr
   0.78%   sre_ucs1_match
   0.50%   lookdict_unicode_nodummy

----------
nosy: +inada.naoki

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue33930>
_______________________________________


More information about the Python-bugs-list mailing list