[pypy-issue] [issue729] Pypy strangely slow when reading files

Da_Blitz tracker at bugs.pypy.org
Thu Jun 2 13:06:46 CEST 2011

Da_Blitz <pypy at pocketnix.org> added the comment:

arigo: after changing to a while loop and using readline directly i can confirm
you are correct. pypy and python have the same behavior when passing small
values of bufsize to fdopen when using readline direct but not when using iteration

i assume it would be best to match cpython's implementation for iteration as it
is both a common idiom and using that pattern it is likely you will be reading
the file in its entirety due to the nature of the idiom. this should hopefully
get rid of some of those "fileio is slow in pypy" complaints

PyPy bug tracker <tracker at bugs.pypy.org>

More information about the pypy-issue mailing list