Topic

The CPython JIT
By: Jeff Glass
Date: July 11, 2024, 6 p.m.

Starting in Python 3.13, CPython includes the option to run with a Just-In-Time Compiler, which emits snippets of machine-code at runtime for added speed. The novel 'copy-and-patch' JIT CPython uses means that the Python runtime doesn't need to actually know anything about compiling this machine-code - it just 'fills in the blanks' of pre-compiled stencils.

This talk will introduce the core concepts of CPython's Tier 2 Interpreter, its copy and patch JIT, and current active areas of exploration. It will also include notes on my own explorations with Superinstructions - sequences of multiple bytecodes compiled together for additional time savings.