[issue19087] bytearray front-slicing not optimized

Antoine Pitrou report at bugs.python.org
Sun Sep 29 23:51:14 CEST 2013


Antoine Pitrou added the comment:

> Deleting a slice at the front of a bytearray have linear complexity
> from the size of a bytearray (in any case del b[:1] is a little faster
> than b[:1] = b''). I doubt than any performance critical code do it
> instead of increasing an index in constant time.

Increasing an index requires that you compact the bytearray from time to
time, lest it fills the whole memory.

----------

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


More information about the Python-bugs-list mailing list