Message198718
> 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. |
|
Date |
User |
Action |
Args |
2013-09-30 19:00:32 | serhiy.storchaka | set | recipients:
+ serhiy.storchaka, pitrou, vstinner |
2013-09-30 19:00:32 | serhiy.storchaka | set | messageid: <1380567632.52.0.561385658366.issue19087@psf.upfronthosting.co.za> |
2013-09-30 19:00:32 | serhiy.storchaka | link | issue19087 messages |
2013-09-30 19:00:32 | serhiy.storchaka | create | |
|