[issue18329] for line in socket.makefile() speed degradation

STINNER Victor report at bugs.python.org
Thu Jul 4 21:39:50 CEST 2013


STINNER Victor added the comment:

On Python 2, socket.makefile("rb") duplicates the file descriptor and creates a new file object: fileobj.read() calls the C function read().

On Python 3, socket.makefile("rb") creates a SocketIO wrapped in BufferedReader: fileobj.read() calls the C function recv() (recvfrom() syscall).

For a UNIX socket, read() is maybe more efficient than recv().

----------
nosy: +haypo

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue18329>
_______________________________________


More information about the Python-bugs-list mailing list