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

Richard Oudkerk report at bugs.python.org
Thu Jul 4 17:20:52 CEST 2013


Richard Oudkerk added the comment:

> I think I know what's going on here. For socket IO readline() uses a 
> readahead buffer size of 1.

Why is that?  I think that makefile(mode='rb') and fdopen() both create BufferedReader objects with the same buffer size.

It looks to me like there are the same number of reads for both cases (about 120,000 ~ data_size/buffer_size).  But with SocketIO, there are 5 function calls for each read into the buffer.

----------

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


More information about the Python-bugs-list mailing list