[pypy-issue] [issue729] Pypy strangely slow when reading files
Vetoshkin Nikita
tracker at bugs.pypy.org
Tue May 31 14:44:09 CEST 2011
Vetoshkin Nikita <nikita.vetoshkin at gmail.com> added the comment:
Just built pypy-c and have almost equal values on textread.py:
[root at minefield tmp]# time python textread.py
20095
real 0m0.039s
user 0m0.032s
sys 0m0.005s
[root at minefield tmp]# time /opt/pypy-1.6a-linux32/bin/pypy textread.py
20095
real 0m0.042s
user 0m0.032s
sys 0m0.009s
Reading from pipe using subprocess module is much slower:
[root at minefield tmp]# time /opt/pypy-1.6a-linux32/bin/pypy zipread.py
20096
real 0m1.502s
user 0m0.411s
sys 0m1.078s
[root at minefield tmp]# time python zipread.py
20096
real 0m0.055s
user 0m0.034s
sys 0m0.009s
I simplified this example:
[root at minefield tmp]# cat zipread_s.py
import os
zipfile = 'textfile.txt.tar.gz'
f = os.popen('zcat %s' % zipfile)
counter = 0
for map_line in f:
counter += 1
print counter
and got these results:
[root at minefield tmp]# time /opt/pypy-1.6a-linux32/bin/pypy zipread_s.py
20096
real 0m0.058s
user 0m0.033s
sys 0m0.012s
[root at minefield tmp]# time python zipread_s.py
20096
real 0m0.050s
user 0m0.046s
sys 0m0.004s
----------
nosy: +nekto0n
status: unread -> chatting
________________________________________
PyPy bug tracker <tracker at bugs.pypy.org>
<https://bugs.pypy.org/issue729>
________________________________________
More information about the pypy-issue
mailing list