我使用 Python 2.7、Windows 7 64 位——Psyco 的替代品?
显然 Psyco 不适用于 Python 2.7。
还有其他选择吗?
Apparently Psyco doesn't work for Python 2.7.
Are there other alternatives?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
当今 Python 编译的最先进水平是 PyPy。我没有任何关于它是否适合您的目标平台的信息。
Today's state of the art in Python compilation is PyPy. I don't have any information about whether it will work for you on your target platform.
我认为没有像 psyco 那样只使用 Python 的真正替代方案(Pypy 日益成为“唯一的 Python”替代方案,它不支持扩展模块,因此,现在许多项目无法迁移,但如果您的项目不支持)其中之一,这可能是一个很好的方法)
如果您现在无法使用 Pypy,在进行配置文件会话并确认在普通 Python 中无法再加快速度后,路径通常是以下之一:
c/c++ 扩展模块(我个人最喜欢的——适用于任何平台,并且使用 boost::python 使这个过程非常简单明了,尽管如果您不懂 c/c++,这可能不会那么容易)。
Cython(您通常必须稍微更改您的程序,以便它在 Cython 中变得更快,并且更改并不是真正的 Python 代码,而是它的扩展)
Shed Skin(如果它可以处理您的程序)
I think there's no real alternative only using Python as psyco does (Pypy which is increasingly becoming the 'only Python' alternative doesn't support extension modules, so, right now, many of projects can't migrate, but if yours isn't one of those, it can be a nice approach)
If you can't use Pypy right now, after doing a profile session and confirming things can't be speed up anymore in plain Python, the path is usually one of:
c/c++ extension module (my personal favorite -- works on any platform and using boost::python makes this process pretty simple and straightforward, although if you don't know c/c++, this may not be so easy).
Cython (you usually have to change your program a bit so that it becomes fast in Cython, and the changes aren't really python code, but an extension of it)
Shed Skin (if it can cope with your program)