On 03/07/13 19:16, Amaury Forgeot d'Arc wrote:

2013/7/3 Eleytherios Stamatogiannakis <[email protected]
<mailto:[email protected]>>

    Hello,

    We also found a case where PyPy is 2x slower than CPython. The
    following code:


This is because of I/O.
If I replace the file with a custom class which has an empty write() method,
pypy is twice faster than CPython.

Ah, i guess that the I/O isn't so much optimized, as the other things are, on PyPy?

Thanks for looking into this test case.

l.

Note: with pypy, io.open() is even slower :-(

    <<<<

    import cPickle

    fileIter=open("pypytesting", "w+b")
    mylist = ["qwerty"] * 100

    for i in xrange(1000000):
             cPickle.dump(mylist, fileIter,1)

     >>>>

    Runs at:
             CPython 2.7.3:  13.114 sec
             PyPy nightly:    29.239 sec

    [Warning: it'll produce a file (pypytesting) that is 205 MB in size]

    Kind regards,

    lefteris.
    _________________________________________________
    pypy-dev mailing list
    [email protected] <mailto:[email protected]>
    http://mail.python.org/__mailman/listinfo/pypy-dev
    <http://mail.python.org/mailman/listinfo/pypy-dev>




--
Amaury Forgeot d'Arc

_______________________________________________
pypy-dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-dev

Reply via email to