如果PyPy快6.3倍,为什么我不应该在CPython上使用PyPy? [英] Why shouldn't I use PyPy over CPython if PyPy is 6.3 times faster?

查看:105
本文介绍了如果PyPy快6.3倍,为什么我不应该在CPython上使用PyPy?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

关于 PyPy 项目,我已经听到很多。他们声称它比 CPython 解释器快6.3倍。 speed.pypy.org rel = noreferrer>其网站。

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.

每当我们谈论诸如Python之类的动态语言时,速度是首要问题之一。为了解决这个问题,他们说PyPy快6.3倍。

Whenever we talk about dynamic languages like Python, speed is one of the top issues. To solve this, they say PyPy is 6.3 times faster.

第二个问题是并行性,臭名昭著的全局解释器锁定(GIL)。为此,PyPy表示可以提供无GIL的Python

The second issue is parallelism, the infamous Global Interpreter Lock (GIL). For this, PyPy says it can give GIL-less Python.

如果PyPy可以解决这些巨大的挑战,那么它的哪些弱点正在阻碍广泛采用?也就是说,是什么阻止了像我这样的人(一个典型的Python开发人员)立即转而使用PyPy

If PyPy can solve these great challenges, what are its weaknesses that are preventing wider adoption? That is to say, what's preventing someone like me, a typical Python developer, from switching to PyPy right now?

推荐答案


注意:PyPy比起现在更加成熟并且得到了更好的支持是在2013年,有人问这个问题。避免从过时的信息中得出结论。

NOTE: PyPy is more mature and better supported now than it was in 2013, when this question was asked. Avoid drawing conclusions from out-of-date information.








  1. PyPy,就像其他人很快提到的那样,对C扩展的长期支持。它具有 支持,但通常速度低于Python,而且充其量也很不稳定。因此,很多模块只是 require CPython。 PyPy不支持numpy PyPy现在支持numpy 。某些扩展程序仍不受支持(熊猫,SciPy等),请先查看支持的软件包列表进行更改。

  2. Python 3支持目前仍处于试验阶段。 刚刚稳定!自2014年6月20日起, PyPy3 2.3.1-Fulcrum退出了

  3. PyPy有时对
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆