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

Марк Коренберг report at bugs.python.org
Sun Jun 30 00:09:07 CEST 2013


Марк Коренберг added the comment:

Eliminate unicode conversion for python3, but results still the same

$ python2.7 qwe.py 
TCP  mode, makefile method. 211416.5 lines per second (201.6 MB/s). Delay is 4.73 seconds
TCP  mode,   fdopen method. 1041666.7 lines per second (993.4 MB/s). Delay is 0.96 seconds
UNIX mode, makefile method. 2040816.3 lines per second (1946.3 MB/s). Delay is 0.49 seconds
UNIX mode,   fdopen method. 1886792.5 lines per second (1799.4 MB/s). Delay is 0.53 seconds

$ python3.2 qwe.py 
TCP  mode, makefile method. 487804.9 lines per second (465.2 MB/s). Delay is 2.05 seconds
TCP  mode,   fdopen method. 900900.9 lines per second (859.2 MB/s). Delay is 1.11 seconds
UNIX mode, makefile method. 625000.0 lines per second (596.0 MB/s). Delay is 1.60 seconds
UNIX mode,   fdopen method. 1492537.3 lines per second (1423.4 MB/s). Delay is 0.67 seconds

$ python3.3 qwe.py 
TCP  mode, makefile method. 512820.5 lines per second (489.1 MB/s). Delay is 1.95 seconds
TCP  mode,   fdopen method. 884955.8 lines per second (844.0 MB/s). Delay is 1.13 seconds
UNIX mode, makefile method. 680272.1 lines per second (648.8 MB/s). Delay is 1.47 seconds
UNIX mode,   fdopen method. 1587301.6 lines per second (1513.8 MB/s). Delay is 0.63 seconds

Also, io.BufferedReader() is not my case. I understand that intermediate buffer will increase performance. Problem in implementation of socket.makefile(). That is I want to be fixed.

----------
Added file: http://bugs.python.org/file30732/qwe.py

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


More information about the Python-bugs-list mailing list