Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> the code needs to be ported to work under PyPy.

The only incompatibility is the `.copy()` calls which should be replaced by `list(contents)`, then it'll be cross-compatible between P2 and P3.

Here's what I get with that (on a 2010 MBP) using the random generation of lgas above (1M random ints):

    > time python2.7 qs.py
    python2.7 qs.py  41.92s user 0.37s system 98% cpu 42.837 total
    > time python3.6 qs.py
    python3.6 qs.py  42.99s user 0.32s system 98% cpu 44.047 total
    > time pypy qs.py
    pypy qs.py  3.27s user 0.12s system 94% cpu 3.603 total
There's a fair bit of variation but pypy is between 3.4 and 4


PyPy supports Python 3, so you don't need to port it at all.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: