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.000557902
Marked as misclassified No
Message-id <>
Simply bumping TextIOWrapper._CHUNK_SIZE from 128 to 1024 yields some
significant performance improvements.

./python -m timeit -s "f=open('LICENSE')" "" "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')" "" "while pass"
 -> with 128: 4.03 msec per loop
 -> with 1024: 1.25 msec per loop

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