New submission from Antoine Pitrou <[email protected]>:
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?
----------
messages: 77814
nosy: christian.heimes, pitrou
priority: high
severity: normal
status: open
title: Increase TextIOWrapper._CHUNK_SIZE
type: performance
versions: Python 3.0
_______________________________________
Python tracker <[email protected]>
<http://bugs.python.org/issue4663>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com