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 benjamin.peterson, pitrou, serhiy.storchaka, stutzbach, vstinner
Date 2017-06-19.14:21:06
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1497882067.09.0.778319622352.issue30404@psf.upfronthosting.co.za>
In-reply-to
Content
Writing separate lines:

$ ./python -m timeit -s 'import sys' -s 'with open("setup.py") as f: s = f.readlines()' 'sys.stderr.writelines(s)' 2>/dev/null
200 loops, best of 5: 1.07 msec per loop

$ ./python -u -m timeit -s 'import sys' -s 'with open("setup.py") as f: s = f.readlines()' 'sys.stderr.writelines(s)' 2>/dev/null
Unpatched:  50 loops, best of 5: 5.89 msec per loop
Patched:    100 loops, best of 5: 3.32 msec per loop

Writing separate characters:

$ ./python -m timeit -s 'import sys' -s 'with open("setup.py") as f: s = list(f.read())' 'sys.stderr.writelines(s)' 2>/dev/null
10 loops, best of 5: 30 msec per loop

$ ./python -u -m timeit -s 'import sys' -s 'with open("setup.py") as f: s = list(f.read())' 'sys.stderr.writelines(s)' 2>/dev/null
Unpatched:  5 loops, best of 5: 49.2 msec per loop
Patched:    2 loops, best of 5: 137 msec per loop
History
Date User Action Args
2017-06-19 14:21:07serhiy.storchakasetrecipients: + serhiy.storchaka, pitrou, vstinner, benjamin.peterson, stutzbach
2017-06-19 14:21:07serhiy.storchakasetmessageid: <1497882067.09.0.778319622352.issue30404@psf.upfronthosting.co.za>
2017-06-19 14:21:07serhiy.storchakalinkissue30404 messages
2017-06-19 14:21:06serhiy.storchakacreate