This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author serhiy.storchaka
Recipients pitrou, serhiy.storchaka, vstinner
Date 2013-09-30.19:00:32
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1380567632.52.0.561385658366.issue19087@psf.upfronthosting.co.za>
In-reply-to
Content
> 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.
History
Date User Action Args
2013-09-30 19:00:32serhiy.storchakasetrecipients: + serhiy.storchaka, pitrou, vstinner
2013-09-30 19:00:32serhiy.storchakasetmessageid: <1380567632.52.0.561385658366.issue19087@psf.upfronthosting.co.za>
2013-09-30 19:00:32serhiy.storchakalinkissue19087 messages
2013-09-30 19:00:32serhiy.storchakacreate