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 Arfrever, benjamin.peterson, dw, eli.bendersky, hynek, jcon, kmike, meador.inge, ncoghlan, pitrou, python-dev, scoder, serhiy.storchaka, skrah, stutzbach, tshepang, vstinner
Date 2014-08-14.21:01:52
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <4131451.8WcIjkiAj7@raxxla>
In-reply-to <1408047103.53.0.936173316809.issue15381@psf.upfronthosting.co.za>
Content
I posted benchmarks two years ago, in msg165795. Here are updated results:

$ ./python -m timeit -s "import io; n=100; d=[b'a'*n,b'bb'*n,b'ccc'*n]*10000"  "s=io.BytesIO(); w=s.write"  "for x in d: w(x)"  "s.getvalue()"

Before patch: 10 loops, best of 3: 42.3 msec per loop
After patch: 10 loops, best of 3: 27.6 msec per loop

$ ./python -m timeit -s "import io; n=1000; 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()"

Before patch: 10 loops, best of 3: 28.7 msec per loop
After patch: 100 loops, best of 3: 14.8 msec per loop

They don't depend from the resizing factor on Linux. I increased it in hope it will help on Windows.
History
Date User Action Args
2014-08-14 21:01:52serhiy.storchakasetrecipients: + serhiy.storchaka, ncoghlan, pitrou, scoder, vstinner, benjamin.peterson, stutzbach, Arfrever, eli.bendersky, skrah, meador.inge, tshepang, python-dev, jcon, hynek, dw, kmike
2014-08-14 21:01:52serhiy.storchakalinkissue15381 messages
2014-08-14 21:01:52serhiy.storchakacreate