Python 想要不修改程序,又需要加快运行速度,可以考虑使用 Pypy 来达成。
- 注:Pypy 兼容 Python,但是也不是 100% 兼容,很多另外安装的 Library 都不兼容。
Debian Linux 安装 pypy 的 twisted 与 pymemcache
pypy 的官方网站与介绍
- pypy:PyPy is a fast, compliant alternative implementation of the Python language (2.7.12 and 3.3.5). 注:Just-in-Time compiler (JIT compiler)
pypy 安装与相关套件安装
于 Debian Linux 想要安装 pypy 很简单,但是想要另外安装 twisted 与 memcached 的 Library 可参考下述步骤:
- apt-get install pypy # 安装 pypy,这样子已经可以直接使用了
- 下述要安装 pypy 的相关套件,使用 easy_install 来安装
- apt-get install python-dev python3-pip pypy-dev
- wget https://bootstrap.pypa.io/ez_setup.py -O - | pypy # 安装 pypy 版本的 easy_install
- easy_install twisted
- easy_install pymemcache
- 到此就可以直接使用啰~