Python 3.14 with JIT enabled . SRC: https://github.com/vroomfondel/somestuff/tree/main/python314jit
986
Python 3.14 with Experimental JIT (Docker)
This directory builds a Docker image that contains CPython 3.14 compiled from source with the experimental JIT enabled. It also includes a small Python script to inspect build/runtime JIT status.
Why this is useful
PYTHON_JIT environment variable.Contents
--enable-experimental-jit, shared libs, LTO, and installs it to /usr/local. The default command is python3._opcode.get_executor(...) after warming up a function.Prerequisites
tonistiigi/binfmt).Security and configuration
The build helper sources ../scripts/include.sh, which may in turn load a local, untracked file such as scripts/include.local.sh. Use that file to store credentials locally and keep secrets out of version control.
Example scripts/include.local.sh (do not commit):
export DOCKER_TOKENUSER="your-docker-username"
export DOCKER_TOKEN="<your-access-token>"
Quick start
./build.sh onlylocal
This creates a local image tagged by default as xomoxcc/python314-jit:trixie and also adds :latest.
docker run -it --rm -e PYTHON_JIT=1 xomoxcc/python314-jit:trixie
The Dockerfile sets PYTHON_JIT=1 by default. You can override with -e PYTHON_JIT=0 to disable JIT at runtime.
# from this directory
docker run -i --rm -e PYTHON_JIT=1 xomoxcc/python314-jit:trixie < checkpython.py
The script prints:
--enable-experimental-jit.PYTHON_JIT._opcode at various bytecode offsets. If found, JIT appears active.Multi-arch build and push
To build for amd64 and arm64 and push to the registry configured by DOCKER_IMAGE in build.sh:
./build.sh
The script will:
mbuilder exists.Notes about CPython 3.14 JIT
_opcode probing used by checkpython.py is a best-effort indicator and may need adjustments for future builds.--enable-experimental-jit enables JIT capability.PYTHON_JIT=1 requests JIT; PYTHON_JIT=0 disables it.sys._is_gil_enabled() in 3.13+).Troubleshooting
scripts/include.local.sh if you need to push.PYTHON_JIT=1, let the warmup loop run, and note that internals can change across Python minor releases.License
See the repository's license files in the project root (LICENSE.md, LICENSEMIT.md, etc.).
This is a development/experimental project. For production use, review security settings, customize configurations, and test thoroughly in your environment. Provided "as is" without warranty of any kind, express or implied, including but not limited to the warranties of merchantability, fitness for a particular purpose and noninfringement. In no event shall the authors or copyright holders be liable for any claim, damages or other liability, whether in an action of contract, tort or otherwise, arising from, out of or in connection with the software or the use or other dealings in the software. Use at your own risk.
Content type
Image
Digest
sha256:c372914bc…
Size
975.2 MB
Last updated
8 months ago
docker pull xomoxcc/python314-jit