[issue26301] ceval.c: reintroduce fast-path for list[index] in BINARY_SUBSCR

STINNER Victor report at bugs.python.org
Fri Feb 5 20:49:13 EST 2016


STINNER Victor added the comment:

(Oops, I attached the wrong patch, fixed in patch v2.)

Quick & dirty micro-benchmark:

Original:

$ ./python -m timeit -s 'lst=list("hello")' 'lst[2]'
10000000 loops, best of 3: 0.0261 usec per loop

Patched:

$ ./python -m timeit -s 'lst=list("hello")' 'lst[2]'
10000000 loops, best of 3: 0.0186 usec per loop

----------
Added file: http://bugs.python.org/file41834/binary_subscr-2.patch

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


More information about the Python-bugs-list mailing list