[issue19369] PyObject_LengthHint is slow

Antoine Pitrou report at bugs.python.org
Wed Oct 23 21:40:47 CEST 2013


Antoine Pitrou added the comment:

Here is a patch. Micro-benchmark:

$ ./python -m timeit -s "l=[]; it=(x for x in ())" "l.extend(it)"
-> before: 0.449 usec per loop
-> after: 0.179 usec per loop

----------
keywords: +patch
Added file: http://bugs.python.org/file32318/lengthhint.patch

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


More information about the Python-bugs-list mailing list