I&#39;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">&lt;<a href="mailto:kristjan@ccpgames.com">kristjan@ccpgames.com</a>&gt;</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>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # _rbufsize is the suggested recv buffer size.&nbsp; It
is *strictly*</p>

<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # obeyed within readline() for recv calls.&nbsp; If it is
larger than</p>

<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # default_bufsize it will be used for recv calls
within read().</p>

<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </p>

<p>What I worry about is the readline() case.&nbsp; Is there a
reason why we want to strictly obey it for that function?&nbsp; Note that in the
documentation for _fileobject.read() it says:</p>

<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Use max, disallow tiny reads in a loop as they are
very inefficient.</p>

<p>&nbsp;</p>

<p>The same argument surely applies for readline().</p>

<p>&nbsp;</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.&nbsp; But this has the side effect of setting the _rbufsize to 1, and
so readline() calls become very slow.</p>

<p>&nbsp;</p>

<p>I suggest that readline() be made to use at least defaultbufsize,
like read().&nbsp; Any thoughts?</p>

<p>&nbsp;</p>

<p>Cheers,</p>

<p>&nbsp;</p>

<p>Kristján</p>

<p>&nbsp;</p>

<p>&nbsp;</p>

<p>&nbsp;</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>