[issue2632] socket._fileobject.read(n) should ignore _rbufsize when 1

2008-04-14 Thread Curt Hagenlocher

New submission from Curt Hagenlocher <[EMAIL PROTECTED]>:

First reported by Ralf Schmitt.
I haven't checked 2.6 or 3.0.

--
components: Library (Lib)
files: socket.py.diff
keywords: patch
messages: 65472
nosy: CurtHagenlocher
severity: normal
status: open
title: socket._fileobject.read(n) should ignore _rbufsize when 1
type: performance
versions: Python 2.5
Added file: http://bugs.python.org/file10029/socket.py.diff

__
Tracker <[EMAIL PROTECTED]>
<http://bugs.python.org/issue2632>
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2632] socket._fileobject.read(n) should ignore _rbufsize when 1

2008-04-14 Thread Curt Hagenlocher

Curt Hagenlocher <[EMAIL PROTECTED]> added the comment:

I've attached a much better patch as suggested by Guido

Added file: http://bugs.python.org/file10032/socket.py.diff

__
Tracker <[EMAIL PROTECTED]>
<http://bugs.python.org/issue2632>
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2632] socket._fileobject.read(n) should ignore _rbufsize when 1

2008-04-14 Thread Curt Hagenlocher

Changes by Curt Hagenlocher <[EMAIL PROTECTED]>:


Removed file: http://bugs.python.org/file10029/socket.py.diff

__
Tracker <[EMAIL PROTECTED]>
<http://bugs.python.org/issue2632>
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2632] performance problem in socket._fileobject.read

2008-04-15 Thread Curt Hagenlocher

Curt Hagenlocher <[EMAIL PROTECTED]> added the comment:

At least in 2.5.2, there appear to be only two places in the standard 
library where an arbitrary and unchecked size is passed directly to 
_socketobject.recv.  _fileobject.read is one such place and the other 
is in logging/config.py.  In both cases, the pattern is something like

while len(data) < size:
data = data + sock.recv(size - len(data))

Of course, the same pattern may exist in any number of instances of 
user code that performs a socket.recv, and all of these would be 
subject to the same memory thrashing problem that originally beset 
imaplib.

As such, I now agree with Ralf that the fix ultimately belongs in 
_socketobject.  However, deploying a fix for 2.5.2 is probably easier 
if it's in socket.py than if it requires a recompile.

--
title: socket._fileobject.read(n) should ignore _rbufsize when 1 -> performance 
problem in socket._fileobject.read

__
Tracker <[EMAIL PROTECTED]>
<http://bugs.python.org/issue2632>
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com