Message198665
> Is there a problem with that?
No more than with msg198657.
> Sorry, I don't get your point. It's not become Python is inefficient that developers must develop workarounds.
I'm not sure that "workarounds" are much worst than using this optimization. At least we still not seen real code which will benefit from this optimization.
> Antoine's patch is simple, elegant, and offer better performances for "free".
It offer better performances for "free" only for suboptimal code which currently have O(N) instead of O(1).
One of most used cases for bytearrays is accumulating. And the patch slow down this case.
$ ./python -m timeit "b = bytearray(); a = b'x'" "for i in range(10000): b += a" "bytes(b)"
Without patch: 4.3 msec per loop
With patch: 4.62 msec per loops |
|
Date |
User |
Action |
Args |
2013-09-29 22:41:15 | serhiy.storchaka | set | recipients:
+ serhiy.storchaka, pitrou, vstinner |
2013-09-29 22:41:15 | serhiy.storchaka | set | messageid: <1380494475.72.0.544283364206.issue19087@psf.upfronthosting.co.za> |
2013-09-29 22:41:15 | serhiy.storchaka | link | issue19087 messages |
2013-09-29 22:41:15 | serhiy.storchaka | create | |
|