PyPy allows running Python code up to multiple times faster. Not all packages are supported, but it can be worth a try, particularly for heavy “pure Python” workloads.
- download PyPy3 as matching your operating system. Extract to your home directory.
- make a softlink so that
pypy3will just work:
ln -s ~/pypy3-*-linux64/bin/pypy3 ~/.local/bin
- Install/upgrade basic tools
pypy3 -m ensurepip pypy3 -m pip install -U pip setuptools wheel
- The standard Numpy is recommended over deprecated NumPyPy:
pypy3 -m pip install numpy
Some things don’t work yet easily, like
mypy but give PyPy3 a go and see if it will speed up your workload.