Skip to content
Kevin Modzelewski edited this page Nov 19, 2022 · 25 revisions

Using Pyston-lite

Using pyston-lite is simply a matter of running pip install pyston_lite_autoload, which will install and enable Pyston for all future runs in that environment.

Benchmarking

Benchmarking pyston-lite using the standard pyperformance tool is a bit tricky, because pyperformance runs benchmarks in separate virtual environments, which won't contain pyston-lite even if pyperformance itself is running under pyston-lite. To properly benchmark pyston-lite, one can use our wrapper script run_pyperformance.py:

git clone https://github.com/pyston/python-macrobenchmarks/

EXTRA_WHEELS=pyston_lite python3 python-macrobenchmarks/run_pyperformance.py run

Using Pyston-full

Using pyston-full should just be a matter of downloading one of our releases and running the resulting binary instead of python, though please see the following section about setuptools. Please let us know on our Discord or GitHub issues if you have any issues.

Pyston currently only works on x86_64 and amd64 systems.

Virtual environment

We recommend setting up a virtual environment for using Pyston, though it is also possible to install system-wide pyston packages using pip-pyston.

Options in decreasing order of recommendation:

  • Create a new virtual environment using pyston -m venv DIR then use DIR/bin/pip to install packages
  • Install your packages using pip-pyston install --user
  • Run sudo pip install --upgrade virtualenv (this does not work in user mode) and then use the updated virtualenv to create a new Pyston virtual environment
  • Use the system-provided virtualenv, but on Ubuntu you may have to run $env/bin/pip install --upgrade setuptools if your system virtualenv comes from the python3-virtualenv package which is fairly old

pipenv should also work though the Pyston authors are unfamiliar with it.

C extensions

Pyston has full API compatibility with CPython C extensions, but is configured to rebuild them when installed. This typically just works, but there are some libraries that don't provide a way to automatically recompile their C extensions (ex mypy, pytorch, tensorflow). Our plan is to work with library distributors to produce Pyston builds of these libraries.

Other flags

We offer a couple environment variables you can use to adjust our heuristics to your workload:

  • JIT_MIN_RUNS: Ten times the number of function calls before we JIT a function. Type: integer. Default: 2000
  • JIT_MAX_MEM: The maximum number of bytes to allocate for JIT'd code. Type: integer. Default: 100000000 (100MB)

Other pages

We have a small number of semantic changes that should not affect general usage but are listed for completeness.