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 christian.heimes, pitrou
Date 2008-12-14.18:18:29
SpamBayes Score 0.0005579022
Marked as misclassified No
Message-id <1229278711.0.0.240635346547.issue4663@psf.upfronthosting.co.za>
In-reply-to
Content
Simply bumping TextIOWrapper._CHUNK_SIZE from 128 to 1024 yields some
significant performance improvements.

./python -m timeit -s "f=open('LICENSE')" "f.seek(0)" "for line in f: pass"
 -> with 128: 6.21 msec per loop
 -> with 1024: 3.41 msec per loop

./python -m timeit -s "f=open('LICENSE')" "f.seek(0)" "while
f.read(100): pass"
 -> with 128: 4.03 msec per loop
 -> with 1024: 1.25 msec per loop

Is there any counter-indication to doing so?
History
Date User Action Args
2008-12-14 18:18:31pitrousetrecipients: + pitrou, christian.heimes
2008-12-14 18:18:30pitrousetmessageid: <1229278711.0.0.240635346547.issue4663@psf.upfronthosting.co.za>
2008-12-14 18:18:30pitroulinkissue4663 messages
2008-12-14 18:18:29pitroucreate