{"id":6436,"library":"pyston","title":"Pyston (JIT for Python)","description":"Pyston is a high-performance JIT (Just-In-Time) compiler for Python, designed to significantly speed up Python applications by dynamically optimizing code at runtime. Currently at version 2.3.5, it provides performance improvements and aims for high compatibility with CPython. Its `pyston_lite` extension module offers an easy way to integrate the JIT into existing Python environments, receiving regular updates and enhancements.","status":"active","version":"2.3.5","language":"en","source_language":"en","source_url":"https://www.github.com/pyston/pyston","tags":["JIT","performance","runtime","python-runtime","compiler"],"install":[{"cmd":"pip install pyston_lite_autoload","lang":"bash","label":"Install Pyston JIT as an extension module"}],"dependencies":[],"imports":[{"note":"This import enables the Pyston JIT for the current Python process. There are typically no other modules or classes to import directly from Pyston for its JIT functionality itself. The 'pyston' package itself on PyPI is generally a placeholder, with the JIT functionality provided via 'pyston_lite_autoload'.","symbol":"pyston_lite_autoload","correct":"import pyston_lite_autoload"}],"quickstart":{"code":"import pyston_lite_autoload\nimport time\n\ndef fibonacci(n):\n    if n <= 1:\n        return n\n    else:\n        return fibonacci(n-1) + fibonacci(n-2)\n\nif __name__ == \"__main__\":\n    print(\"Pyston JIT enabled by 'pyston_lite_autoload' import.\")\n    n_val = 35 # A value that takes noticeable time to compute\n\n    start_time = time.perf_counter()\n    result = fibonacci(n_val)\n    end_time = time.perf_counter()\n\n    print(f\"Fibonacci({n_val}) = {result}\")\n    print(f\"Time taken: {end_time - start_time:.4f} seconds\")\n\n    # For benchmarking, run this script with and without the 'import pyston_lite_autoload'\n    # to observe potential performance differences.","lang":"python","description":"This quickstart demonstrates how to enable the Pyston JIT by simply importing `pyston_lite_autoload`. Once imported, the JIT automatically optimizes suitable Python code during execution, potentially leading to performance improvements without requiring any further code changes. For optimal observation, run a computationally intensive function."},"warnings":[{"fix":"Upgrade to Ubuntu 18.04 or newer for the full Pyston distribution, or use an older Pyston version compatible with 16.04.","message":"Ubuntu 16.04 support was removed in Pyston 2.3.2 due to a dependency dropping support. Users relying on the full Pyston distribution on this OS version must upgrade their operating system or use an older Pyston release.","severity":"breaking","affected_versions":">=2.3.2"},{"fix":"Use `pip install pyston_lite_autoload` to enable the JIT within a standard CPython environment. Avoid `pip install pyston` if you intend to use the JIT as an extension.","message":"The primary way to enable the Pyston JIT for an existing Python environment via pip is to install `pyston_lite_autoload`. Attempting to install the `pyston` package via `pip` does not enable the JIT; `pyston` typically refers to the standalone Python distribution, installed via other means (e.g., .deb packages, portable archives).","severity":"gotcha","affected_versions":"All versions supporting `pyston_lite_autoload`"},{"fix":"For Pyston 2.3 portable users, ensure you are using `pyston_2.3_portable-v3.tar.gz` or newer, or switch to `pyston_lite_autoload` for easier updates.","message":"Older portable releases of Pyston (e.g., v2.3_portable-v2) contained important bugs (e.g., related to issues #41 and #76) that were fixed in subsequent portable updates (e.g., v2.3_portable-v3). Users of portable distributions should ensure they have the latest patch version for stability.","severity":"gotcha","affected_versions":"2.3 (portable distribution only)"},{"fix":"Update to Pyston 2.3.2 or newer. If using older versions, consult Pyston documentation for known `setuptools` workarounds or ensure `setuptools` is up-to-date and compatible.","message":"Pyston versions prior to 2.3.2 might experience `setuptools` incompatibilities during package building or installation. A workaround was introduced in version 2.3.2.","severity":"gotcha","affected_versions":"<2.3.2"},{"fix":"When using Pyston-full, be prepared to recompile C extensions. Consider using `pyston_lite_autoload` with your existing CPython if recompilation is problematic for specific libraries.","message":"Pyston-full (the complete distribution) is API-compatible but not ABI-compatible with CPython. This means C extensions generally need to be recompiled when installing packages, which can sometimes lead to issues if binary wheels are not available for Pyston or if necessary build tools (like Rust compiler) are missing.","severity":"gotcha","affected_versions":"All versions of full Pyston distribution"}],"env_vars":null,"last_verified":"2026-04-15T00:00:00.000Z","next_check":"2026-07-14T00:00:00.000Z"}