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 pitrou
Recipients Arfrever, eli.bendersky, jcon, meador.inge, ncoghlan, pitrou, serhiy.storchaka, tshepang
Date 2012-07-20.21:18:45
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1342819126.43.0.572232104551.issue15381@psf.upfronthosting.co.za>
In-reply-to
Content
Well, with the latest patch I get:

$ ./python -m timeit -s "import io; n=2000; d=[b'a'*n,b'bb'*n,b'ccc'*n]*1000"  "s=io.BytesIO(); w=s.write"  "for x in d: w(x)"  "s.getvalue()"
1000 loops, best of 3: 982 usec per loop

$ ./python -m timeit -s "import io; n=2000; d=[b'a'*n,b'bb'*n,b'ccc'*n]*1000"  "s=io.BytesIO(); w=s.write"  "for x in d: w(x)"  "global y; y = s.getvalue()"
100 loops, best of 3: 4.79 msec per loop
History
Date User Action Args
2012-07-20 21:18:46pitrousetrecipients: + pitrou, ncoghlan, Arfrever, eli.bendersky, meador.inge, tshepang, jcon, serhiy.storchaka
2012-07-20 21:18:46pitrousetmessageid: <1342819126.43.0.572232104551.issue15381@psf.upfronthosting.co.za>
2012-07-20 21:18:45pitroulinkissue15381 messages
2012-07-20 21:18:45pitroucreate