New submission from Lefteris Stamatogiannakis <[email protected]>:

Reading a file in pypy can be up to ~2x slower than CPython.

Antonio Cuni mentioned that it may be a problem with the low level 
implementation of pypy:

On 4/7/2013 9:12 am, Antonio Cuni wrote:
"Few days ago I discovered that there is an easy optimization for this. If you 
look at how 
str2charp & friends are implemented, you see that we do an RPython loop and 
copy char by 
char.
By contrast, things like string concatenation are implemented using memcpy and 
are much 
faster (like 3-4 times, iirc)."

Example code:

f=open("text.txt", "w+b")
s="qwerty" * 10 + '\n'

for i in xrange(100000):
    f.write(s)

----------
messages: 5905
nosy: estama, pypy-issue
priority: performance bug
status: unread
title: I/O in pypy is up to 2x slower than CPython

________________________________________
PyPy bug tracker <[email protected]>
<https://bugs.pypy.org/issue1528>
________________________________________
_______________________________________________
pypy-issue mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-issue

Reply via email to