{"id":13429228,"url":"https://github.com/pyston/pyston","last_synced_at":"2025-04-27T03:55:23.520Z","repository":{"id":38040926,"uuid":"343576900","full_name":"pyston/pyston","owner":"pyston","description":"(No longer maintained) A faster and highly-compatible implementation of the Python programming language.","archived":false,"fork":false,"pushed_at":"2024-08-12T16:30:59.000Z","size":328927,"stargazers_count":2505,"open_issues_count":50,"forks_count":94,"subscribers_count":38,"default_branch":"pyston_main","last_synced_at":"2025-04-27T03:55:19.413Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://www.pyston.org/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pyston.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2021-03-01T22:38:24.000Z","updated_at":"2025-04-26T22:55:14.000Z","dependencies_parsed_at":"2024-04-28T01:56:11.062Z","dependency_job_id":"d0371054-4a97-4583-b55e-76f6d3b5184a","html_url":"https://github.com/pyston/pyston","commit_stats":{"total_commits":94868,"total_committers":1075,"mean_commits":88.2493023255814,"dds":0.8848821520428385,"last_synced_commit":"6103fc013e9dd726efca9100a22be1ac08c58591"},"previous_names":[],"tags_count":472,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pyston%2Fpyston","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pyston%2Fpyston/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pyston%2Fpyston/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pyston%2Fpyston/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pyston","download_url":"https://codeload.github.com/pyston/pyston/tar.gz/refs/heads/pyston_main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251085194,"owners_count":21533841,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-07-31T02:00:31.309Z","updated_at":"2025-04-27T03:55:23.502Z","avatar_url":"https://github.com/pyston.png","language":"Python","funding_links":[],"categories":["Python","Others","Containers \u0026 Language Extentions \u0026 Linting","Projects with already integrated BOLT into their build scripts","Python Implementations"],"sub_categories":["For Python","PGO support in build systems"],"readme":"# Pyston\n\nPyston is a performance-optimizing JIT for Python, and is drop-in compatible with the standard Python interpreter.\n\nThere are two ways to use the Pyston JIT:\n\n- Pyston \"full\" is a fork of CPython 3.8.12 which contains the JIT as well as numerous other optimizations. It is roughly 30% faster than CPython on web serving macrobenchmarks.\n- Pyston \"lite\" is an extension module that contains just the JIT. It is available for Python 3.7, 3.8, 3.9, and 3.10, and is easily pip-installable. It is roughly 10% faster on macrobenchmarks.\n\nPyston-full can be downloaded and installed from our [releases](https://github.com/pyston/pyston/releases) page.\n\nPyston-lite can be installed using pip: simply run `pip install pyston_lite_autoload` to install the jit as well as an autoloader that enables the jit when Python starts up.\n\n[Discord](https://discord.gg/S7gsqnb)\n\n[Blog](https://blog.pyston.org/)\n\n## Techniques\n\nWe plan on explaining our techniques in more detail in future blog posts, but the main ones we use are:\n\n- A very-low-overhead JIT using DynASM\n- Quickening\n- Aggressive attribute caching\n- General CPython optimizations (pyston-full only)\n- Build process improvements (pyston-full only)\n\n## Docker images\n\nWe have some experimental docker images on DockerHub with Pyston-full pre-installed, you can quickly try out Pyston by doing\n\n```\ndocker run -it pyston/pyston\n```\n\nYou could also attempt to use this as your base image, and `python` will be provided by Pyston.\n\nThe default image contains quite a few libraries for compiling extension modules, and if you'd like a smaller image we also have a `pyston/slim` version that you can use.\n\nThese have not been heavily tested, so if you run into any issues please report them to our tracker.\n\n## Checking for Pyston at runtime\n\nTo check for pyston-full, one can run `hasattr(sys, \"pyston_version_info\")`.\n\nTo check whether pyston-lite has been loaded, one can run `\"pyston_lite\" in sys.modules`.\n\n## Installing packages\n\nPyston-full is *API compatible* but not *ABI compatible* with CPython. This means that C extensions will work, but they need to be recompiled.\n\nTypically with Python one will download and install pre-compiled packages, but with Pyston there are currently not pre-compiled packages available (we're working on that) so the compilation step will run when you install them. This means that you may run into problems installing packages on Pyston when they work on CPython: the same issues you would have trying to recompile these packages for CPython.\n\nMany packages have build-time dependencies that you will need to install to get them to work. For example to `pip install cryptography` you need a Rust compiler, such as by doing `sudo apt-get install rustc`.\n\nPyston-lite sidesteps these issues and is compatible with existing binary packages.\n\n## History\n\nPyston was started at Dropbox in 2014 in order to reduce the costs of its rapidly-growing Python server fleet. That version of Pyston is now called \"Pyston v1\", and is located [here](https://github.com/pyston/pyston_v1). Pyston v1 was a from-scratch implementation of Python 2.7 that featured a conservative tracing garbage collector and a LLVM-based compilation tier. The tracing garbage collector was eventually replaced with reference counting, and a faster-to-compile baseline JIT was added as well.\n\nAt the same time that Pyston was being developed, Dropbox was in-parallel investigating other languages as the primary development language for the company. In 2017 it was decided that this was the preferrable approach, and the Pyston project was shut down. At this time Pyston v1 was able to run the Dropbox codebase, but with several caveats such as increased memory and numerous small compatibility challenges.\n\nIn 2019 the Pyston developers regrouped without a corporate sponsor and started investigating alternative approaches to speeding up Python. They ended up deciding to fork CPython 3.8, and by early 2020 they restarted the project in a new codebase, and called it \"Pyston v2\". The first version of Pyston v2 was released in late 2020.\n\nIn mid-2021 the Pyston developers joined Anaconda, which since then has provided funding for the project and packaging expertise.\n\nIn 2022 the Pyston developers released pyston-lite in response to user feedback that switching to pyston-full can be prohibitive.\n\n# Building Pyston-full\n\n## Build dependencies\n\nFirst do\n\n```\ngit submodule update --init pyston/llvm pyston/bolt pyston/LuaJIT pyston/macrobenchmarks\n```\n\nPyston has the following build dependencies:\n\n```\nsudo apt-get install build-essential git cmake clang libssl-dev libsqlite3-dev luajit python3.8 zlib1g-dev virtualenv libjpeg-dev linux-tools-common linux-tools-generic linux-tools-`uname -r`\n```\n\nExtra dependencies for running the test suite:\n```\nsudo apt-get install libwebp-dev libjpeg-dev python3.8-gdbm python3.8-tk python3.8-dev tk-dev libgdbm-dev libgdbm-compat-dev liblzma-dev libbz2-dev nginx rustc time libffi-dev\n```\n\nExtra dependencies for producing Pyston debian packages and portable directory release:\n```\nsudo apt-get install dh-make dh-exec debhelper patchelf\n```\n\nExtra dependencies for producing Pyston docker images (on amd64 adjust for arm64):\n```\n# docker buildx\nwget https://github.com/docker/buildx/releases/download/v0.8.1/buildx-v0.8.1.linux-amd64 -O $HOME/.docker/cli-plugins/docker-buildx\nchmod +x $HOME/.docker/cli-plugins/docker-buildx\n# qemu\ndocker run --privileged --rm tonistiigi/binfmt --install arm64\n```\n\n## Building\n\nFor a build with all optimizations enabled (LTO+PGO) run:\n\n```\nmake -j`nproc`\n```\n\nAn initial build will take quite a long time due to having to build LLVM twice, and subsequent builds are faster but still slow due to extra profiling steps.\n\nA symlink to the final binary will be created with the name `pyston3`\n\nFor a quicker build during development run:\n```\nmake unopt -j`nproc`\n```\nthe generated executable can be found inside `build/unopt_install/`\n\nRunning a python file called script.py with pyston can be easily done via:\n```\nmake script_unopt\n```\nor\n```\nmake script_opt\n```\n\n# Building pyston-lite\n\n```\nmake -j`nproc` bolt\ncd pyston/pyston_lite\npython3 setup.py build\n```\n\nYou can set the `NOBOLT=1` environment variable for setup.py if you'd like to skip building bolt. You can also pass `NOPGO=1` and `NOLTO=1` if you'd like the fastest build times, such as for development.\n\nIf you like to build pyston-lite with BOLT (currently only used on x86 Linux) for all supported CPython versions you will need to have python3.7 to python3.10 installed and in your path.\nFor Ubuntu this can most easily done by adding the deadsnakes PPA:\n\n```\nsudo add-apt-repository ppa:deadsnakes/ppa\nsudo apt update\nsudo apt-get install python3.7-full python3.8-full python3.9-full python3.10-full\n```\n\nTo compile wheels for all supported CPython versions and output them into wheelhouse/ run:\n```\nmake package\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpyston%2Fpyston","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpyston%2Fpyston","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpyston%2Fpyston/lists"}