Python includes a JIT compiler as part of its built-in functionality

Available alpha release of programming language Python 3.13.0a6which is notable for the inclusion in the 3.13 branch, on the basis of which the autumn stable release of Python 3.14 is formed, an experimental implementation JIT compilerallowing for significant productivity improvements. To enable JIT in CPython, a build option “–enable-experimental-jit” has been added. JIT requires LLVM to be installed as an additional dependency.

The process of translating machine code into JIT is built using the “Copy-and-Patch“, in which an object file in ELF format is assembled using LLVM, containing data about bytecode instructions and information about the necessary data replacement. JIT replaces bytecode instructions generated during program interpretation with their representations in machine code, simultaneously substituting the data necessary for calculations (JIT copies ready-made templates of already compiled functions and substitutes the necessary values, such as arguments and constants, into them).

The proposed JIT is notable for its very high speed of code generation, ease of maintenance and full integration with the interpreter. Compared to compiling in WebAssembly (Liftoff) the new JIT generates code 5 times faster, and the resulting code runs 50% faster. When compared to traditional JIT tooling, LLVM's added JIT to CPython provides 100x faster code generation and 15% faster resulting code.

Thanks for reading: