[New-bugs-announce] [issue13393] Improve BufferedReader.read1()

Antoine Pitrou report at bugs.python.org
Sun Nov 13 05:15:01 CET 2011

New submission from Antoine Pitrou <pitrou at free.fr>:

The main current user of BufferedReader.read1() is TextIOWrapper. In this context, read1() is used to signal that we want to bypass binary buffering as much as possible, since TextIOWrapper does its own buffering. The current read1() implementation is therefore suboptimal: it copies data around, and limits the number of bytes that you're allowed to get in one call (even if the raw stream would satisfy more).

Attached patch improves read1() in this respect. Also, a separate modification of TextIOWrapper is needed to take advantage of it, which I will attach in another patch.

components: IO, Library (Lib)
files: bufioread1.patch
keywords: patch
messages: 147549
nosy: pitrou
priority: normal
severity: normal
stage: patch review
status: open
title: Improve BufferedReader.read1()
type: performance
versions: Python 3.3
Added file: http://bugs.python.org/file23675/bufioread1.patch

Python tracker <report at bugs.python.org>

More information about the New-bugs-announce mailing list