top | item 33347396

(no title)

CalebJohn | 3 years ago

Out of curiosity I ran the same test on a linux laptop with the Ryzen 7 PRO 6850U CPU.

    python 3.10: 60s
    python 3.11: 46s
    pypy 3.9.12:  6s
Looks like pypy performs comparatively better on x86_64

discuss

order

llimllib|3 years ago

makes sense I guess, it's had a lot more development time I'm sure. Thanks!

nerdponx|3 years ago

I think PyPy runs under Rosetta on M1, so the overhead is probably from that.

llimllib|3 years ago

I don't think so; they released ARM support a while ago: https://doc.pypy.org/en/latest/release-2.1.0.html

(I could be wrong)

edit: oh, huh I think you're right that it's running here on rosetta:

    $ file installs/python/pypy3.9-7.3.9/bin/pypy
    installs/python/pypy3.9-7.3.9/bin/pypy: Mach-O 64-bit executable x86_64
Wonder if there's a way to run a native version?

edit 2: there are nightlies here: https://buildbot.pypy.org/nightly/py3.9/

Running the latest, a native binary gives more than 2x speedup:

    # first you have to allow all the unsigned binaries to run
    $ xattr -dr com.apple.quarantine pypy-c-jit-106295-5dd3b18303e2-macos_arm64/bin/*
    # then we get 3.5s:
    $ time pypy-c-jit-106295-5dd3b18303e2-macos_arm64/bin/pypy nbody.py 10000000
    -0.169075164
    -0.169077842

    real 0m3.522s
    user 0m3.468s
    sys 0m0.045s
pypy continues to impress!