[issue2523] binary buffered reading is quadratic

Alexandre Vassalotti report at bugs.python.org
Tue Jun 10 04:22:58 CEST 2008

Alexandre Vassalotti <alexandre at peadrop.com> added the comment:

Oh, that is simple to fix. You can round the value 2*avail to the
nearest block by doing something like (2*avail) & ~(bksize-1) where
bksize is a power of 2, or the less magic (2*avail//bksize) * bksize.

Python tracker <report at bugs.python.org>

More information about the Python-bugs-list mailing list