I've created <a href="http://bugs.python.org/issue4448">http://bugs.python.org/issue4448</a> to track this issue.<br><br><div class="gmail_quote">On Thu, Nov 27, 2008 at 6:50 AM, Kristján Valur Jónsson <span dir="ltr"><<a href="mailto:kristjan@ccpgames.com">kristjan@ccpgames.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div link="blue" vlink="purple" lang="IS">
<div>
<p>I came across this in socket.c:</p>
<p> # _rbufsize is the suggested recv buffer size. It
is *strictly*</p>
<p> # obeyed within readline() for recv calls. If it is
larger than</p>
<p> # default_bufsize it will be used for recv calls
within read().</p>
<p> </p>
<p>What I worry about is the readline() case. Is there a
reason why we want to strictly obey it for that function? Note that in the
documentation for _fileobject.read() it says:</p>
<p> # Use max, disallow tiny reads in a loop as they are
very inefficient.</p>
<p> </p>
<p>The same argument surely applies for readline().</p>
<p> </p>
<p>The reason I am fretting about this is that httplib.py (and
therefore xmlrpclib.py) specify bufsize=0 when createing their socket fileobjects,
presumably to make sure that write() operations are not buffered but flushed
immediately. But this has the side effect of setting the _rbufsize to 1, and
so readline() calls become very slow.</p>
<p> </p>
<p>I suggest that readline() be made to use at least defaultbufsize,
like read(). Any thoughts?</p>
<p> </p>
<p>Cheers,</p>
<p> </p>
<p>Kristján</p>
<p> </p>
<p> </p>
<p> </p>
</div>
</div>
<br>_______________________________________________<br>
Python-Dev mailing list<br>
<a href="mailto:Python-Dev@python.org">Python-Dev@python.org</a><br>
<a href="http://mail.python.org/mailman/listinfo/python-dev" target="_blank">http://mail.python.org/mailman/listinfo/python-dev</a><br>
Unsubscribe: <a href="http://mail.python.org/mailman/options/python-dev/greg%40krypto.org" target="_blank">http://mail.python.org/mailman/options/python-dev/greg%40krypto.org</a><br>
<br></blockquote></div><br>