Added in CPython 3.13.
To enable tested on Ubuntu 25.04:
git clone https://github.com/python/cpython
cd cpython
git checkout v3.13.7
./configure --enable-experimental-jit
make -j
We can try to test it with python/inc_loop.py:
time ./python python/inc_loop.py 10000000
but the result is just as pathetic as without JIT currently, taking about 1 second for only 10m loops.
This can be compared with the optimal assembly from c/inc_loop_asm.c:
time ./inc_loop_asm.out 1000000000
which does 1 billion loops in about half a second on P14s.
For comparison, PyPy actually speeds things up and does 1 billion loops in about a second, so only 2x worse than native.
TODO triple check that JIT is enabled. Many threads say the command is:
./python -c 'import sysconfig; sysconfig.get_config_var("JIT_DEPS")'
but that fails with:
ModuleNotFoundError: No module named '_sysconfigdata__linux_x86_64-linux-gnu'
For comparison with a properly implemented dynamic language JIT running nodejs/inc_loop.js does 1 billion loops in 0.6s on v22.14.0, close to native.
tonybaloney.github.io/posts/python-gets-a-jit.html documents what the initial "JIT" implementation does. It is just an extremely naive concatenation of instructions that avoids a for + switch. No wonder it doesn't speed things up much at all.

New to topics? Read the docs here!