[Python-Dev] very bad network performance

Ralf Schmitt schmir at gmail.com
Mon Apr 14 18:12:35 CEST 2008

Hi all,

I'm using mercurial with the release25-maint branch. I noticed that checking
out a local repository now takes more than
5 minutes (it should be around 30s).

I've tracked it down to this change:
this is svn revision 61009. Here is the diff inline:

--- a/Lib/socket.py	Fri Mar 23 14:27:29 2007 +0100
+++ b/Lib/socket.py	Sat Feb 23 20:30:59 2008 +0100
@@ -305,7 +305,7 @@
             self._rbuf = ""
             while True:
                 left = size - buf_len
-                recv_size = max(self._rbufsize, left)
+                recv_size = min(self._rbufsize, left)
                 data = self._sock.recv(recv_size)
                 if not data:

self._rbufsize if 1, and so the code reads one byte at a time. this is
clearly wrong, I'm posting it to the mailing list, as I don't want
this issue to get lost in the bugtracker.

- Ralf
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/python-dev/attachments/20080414/eeff8dfc/attachment.htm 

More information about the Python-Dev mailing list