Issue 4663: Increase TextIOWrapper._CHUNK_SIZE - Python tracker (original) (raw)

Issue4663

Created on 2008-12-14 18:18 by pitrou, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Messages (2)
msg77814 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2008-12-14 18:18
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?
msg77890 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2008-12-15 23:04
Committed in r67803, r67804.
History
Date User Action Args
2022-04-11 14:56:42 admin set github: 48913
2008-12-15 23:04:19 pitrou set status: open -> closedresolution: fixedmessages: +
2008-12-14 18🔞30 pitrou create