Why shouldn't I use PyPy over CPython if PyPy is 6.3 times faster?

前端 未结 12 1146
暖寄归人
暖寄归人 2020-12-02 03:12

I\'ve been hearing a lot about the PyPy project. They claim it is 6.3 times faster than the CPython interpreter on their site.

Whenever we talk about dynamic languag

12条回答
  •  悲哀的现实
    2020-12-02 03:56

    That site does not claim PyPy is 6.3 times faster than CPython. To quote:

    The geometric average of all benchmarks is 0.16 or 6.3 times faster than CPython

    This is a very different statement to the blanket statement you made, and when you understand the difference, you'll understand at least one set of reasons why you can't just say "use PyPy". It might sound like I'm nit-picking, but understanding why these two statements are totally different is vital.

    To break that down:

    • The statement they make only applies to the benchmarks they've used. It says absolutely nothing about your program (unless your program is exactly the same as one of their benchmarks).

    • The statement is about an average of a group of benchmarks. There is no claim that running PyPy will give a 6.3 times improvement even for the programs they have tested.

    • There is no claim that PyPy will even run all the programs that CPython runs at all, let alone faster.

提交回复
热议问题