[issue2523] binary buffered reading is quadratic

Antoine Pitrou report at bugs.python.org
Wed Jul 23 11:19:57 CEST 2008

Antoine Pitrou <pitrou at free.fr> added the comment:

> When I revised the patch I had a weak understanding of nonblocking I/O.
> I thought the "exponential" reads were for nonblocking I/O, but I see
> now that is non-sense.

Fine, so it will make the patch simpler.

As for non-blocking IO, I think we should raise the general issue on
python-3000. There is no real support for it right now, by which I mean (1) no
easy and portable way of enable non-blocking IO on a file object and (2) no test
cases of non-blocking IO in real-world conditions (rather than with mock
objects). This shouldn't stop us from fixing the present bug though.

> I am not sure, but I think Martin is also right about the second loop.
> The max() call should be changed back to "max(self.buffer_size, n))",
> like in the 2nd patch.

Ok. Could you produce an updated patch? :)

Python tracker <report at bugs.python.org>

More information about the Python-bugs-list mailing list