Serhiy Storchaka added the comment:

> I'm not sure that it is what you expected: bytearray() is only initialized 
> once ("setup" of timeit). You probably want to reinitialize at each loop.

There is no "setup" of timeit here. And you forgot bytes(b) after accumulating 
loop. bench_bytearray.py shows me 10% slowdown for 10**3 and 10**5 bytes tests.

Of course it can be a measurement glitch. On other hand, there are no 
measurements which show positive effect of the patch for real code. Currently 
we consider only hypothetic code and can't compare it with alternatives.

> The problem is the "suboptimal code" is also the natural way to write such 
> code. If you know a simple and idiomatic way to write an optimal bytes FIFO, 
> then please share it with us.

Please share this written in the "natural way" real code with us. I can't 
compare with alternatives a code which I don't see.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue19087>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to