We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
GitHub fields:
assignee = None closed_at = <Date 2008-12-15.23:04:19.335> created_at = <Date 2008-12-14.18:18:30.226> labels = ['performance'] title = 'Increase TextIOWrapper._CHUNK_SIZE' updated_at = <Date 2008-12-15.23:04:19.334> user = 'https://github.com/pitrou'
bugs.python.org fields:
activity = <Date 2008-12-15.23:04:19.334> actor = 'pitrou' assignee = 'none' closed = True closed_date = <Date 2008-12-15.23:04:19.335> closer = 'pitrou' components = [] creation = <Date 2008-12-14.18:18:30.226> creator = 'pitrou' dependencies = [] files = [] hgrepos = [] issue_num = 4663 keywords = [] message_count = 2.0 messages = ['77814', '77890'] nosy_count = 2.0 nosy_names = ['pitrou', 'christian.heimes'] pr_nums = [] priority = 'high' resolution = 'fixed' stage = None status = 'closed' superseder = None type = 'performance' url = 'https://bugs.python.org/issue4663' versions = ['Python 3.0']
The text was updated successfully, but these errors were encountered:
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?
Sorry, something went wrong.
Committed in r67803, r67804.
No branches or pull requests
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: