[issue17170] string method lookup is too slow

Antoine Pitrou report at bugs.python.org
Sat Feb 9 20:58:53 CET 2013


Antoine Pitrou added the comment:

Some crude C benchmarking on this computer:
- calling PyUnicode_Replace is 35 ns (per call)
- calling "hundred".replace is 125 ns
- calling PyArg_ParseTuple with the same signature as "hundred".replace is 80 ns

Therefore, most of the overhead (125 - 35 = 90 ns) is in calling PyArg_ParseTuple() to unpack the method arguments.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue17170>
_______________________________________


More information about the Python-bugs-list mailing list