Pyston Autoload
Pyston-Autoload automatically detects and enables the Pyston JIT compiler when imported, aiming to provide performance improvements for Python applications. It acts as a bootstrap mechanism for the Pyston runtime. The current version is 2.3.5, and it generally follows the release cadence of the underlying Pyston project.
Warnings
- gotcha Pyston-Autoload only *enables* an existing Pyston runtime; it does not install Pyston itself. Pyston often requires platform-specific installation methods (e.g., .deb packages, portable archives, or conda environments) which need to be set up independently.
- gotcha A distinction exists between `pyston-autoload` and `pyston_lite_autoload`. `pyston-autoload` is for the full Pyston distribution, while `pyston_lite_autoload` (introduced in v2.3.4) is for `pyston_lite`, which is distributed as a Python extension module via PyPI.
- gotcha To ensure Pyston's JIT is active for the entire application, `import pyston_autoload` should be one of the very first statements in your main application script.
- breaking Support for Ubuntu 16.04 was removed due to dependencies removing support. This means portable releases are now based on Ubuntu 18.04.
- gotcha Pyston is distributed with architecture-specific packages (e.g., `amd64` for Intel/AMD x86_64, `arm64` for aarch64 ARM CPUs). Ensure the underlying Pyston runtime matches your system's architecture.
Install
-
pip install pyston-autoload -
pip install pyston_lite_autoload
Imports
- pyston_autoload
import pyston_autoload
Quickstart
import pyston_autoload
import sys
print(f"Pyston Autoload imported. This enables the Pyston JIT if the Pyston runtime is detected.")
print(f"Current Python version: {sys.version}")
# Run some typical Python code. If Pyston is active, it may run faster.
def fib(n):
if n <= 1:
return n
else:
return fib(n-1) + fib(n-2)
print(f"Calculating fib(10): {fib(10)}")