pavelmachek (pavelmachek) wrote,
pavelmachek
pavelmachek

pypy: suprisingly good

Using python for weather forecasting was a mistake... but it came with some surprises. It looks like pypy is as fast as gcc -O0 on simple correlation computation: https://gitlab.com/tui/tui/blob/master/nowcast/pypybench.py (and pypybench.c). gcc -O3 is twice as fast, and plain python2 is 20x slower (or 2000% slower). Python3 is 28x. slower. That's better than I expected for the JIT technology.
Subscribe

  • Using PinePhone

    I was asking at the mailing lists about ofono configuration for PinePhone... and apparently it is not exactly simple to get it to work. (One thing is…

  • Certified danger

    I suspected Linux Foundation went to the dark side when they started strange deals with Microsoft. But I'm pretty sure they went to dark side…

  • Pretty big side-effect

    Timing and side-channels are not normally considered side-effects, meaning compilers and cpus feel free to do whatever they want. And they do.…

  • Post a new comment

    Error

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

    When you submit the form an invisible reCAPTCHA check will be performed.
    You must follow the Privacy Policy and Google Terms of use.
  • 2 comments

Anonymous

April 11 2016, 14:22:14 UTC 5 years ago

I would like to say using CPython was a mistake :-)

Anyway, we're working on the remaining 2x, if you care
Thanks for that, and hey, good luck with that!

Actually, the remaining 2x would be nice... or make it 3x, JIT can be faster than ahead of time compiliing :-)... but there are more pressing issues:

numpy, arm, python3.

I did switch the weather forecast code to numpy, and I'm not looking forward to switching it back. Plus, it is slow on PC, but still usable (like, 30 seconds to do forecast?). It is unusable on arm (like, 15 minutes to do forecast 15 minutes in future). And yes, one day I'd like to switch to python3, as it is better language.