[issue19087] bytearray front-slicing not optimized

Antoine Pitrou report at bugs.python.org
Mon Sep 30 22:22:15 CEST 2013


Antoine Pitrou added the comment:

Other benchmarks for the new patch (exercising FIFO-like behaviour: some data is appended at one end, and popped at the other):

timeit -s "b=bytearray(100000);s=b'x'*100" "b[:100] = b''; b.extend(s)"
-> before: 4.07 usec per loop
-> after: 0.812 usec per loop

For comparison, popping from the end (LIFO-like):

timeit -s "b=bytearray(100000);s=b'x'*100" "b[-100:] = b''; b.extend(s)"
-> before: 0.894 usec per loop
-> after: 0.819 usec per loop

----------

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


More information about the Python-bugs-list mailing list