[Python-Dev] very bad network performance

A.M. Kuchling amk at amk.ca
Mon Apr 14 21:17:25 CEST 2008


On Mon, Apr 14, 2008 at 11:10:12AM -0700, Curt Hagenlocher wrote:
>               while True:
>                   left = size - buf_len
> !                 recv_size = max(self._rbufsize, left)
>                   data = self._sock.recv(recv_size)

What version is this patch against?  (The last 2.5 release, maybe?)
The max() in the above line should be min(), because you want to use
the *smaller* number of the buffer size and the # of remaining bytes
to read, not the *larger*.  This code is using min() in both 25-maint
and trunk.

--amk



More information about the Python-Dev mailing list