What they don't tell you about building a JIT compiler for CPython
summary
An account of building a JIT for CPython that gives concrete tradeoffs: the project uses specialized bytecode and automatic microops generation, emits machine code via copy and patch, and manages executable pages with mmap / VirtualProtect. Measured gains before the JIT already show ~25% faster in 3.11 vs 3.10, ~8% for 3.14, ~50% aggregate in four years and many benchmarks >100% faster. JIT is experimental, shipping disabled in 3.14 binaries and opt‑in via a JIT environment flag.
AI-written summary · about
chapters (11)
- 0:00Introduction
- 1:25Brandts background
- 1:44Faster CPython
- 2:29Python 314
- 3:26Duck simulator
- 9:25Copy and patch
- 10:32Region selection
- 11:50Methodjit
- 18:03Metatracing
- 22:02Debugging Profiling
- 25:00Native debuggers
related talks
29mBuilding a JIT compiler for CPython
01h 03mA tour of CPython's runtime
24mHow two undergrads from the other side of the planet are speeding up...
41mHow to write a JIT compiler in 30 minutes
29mHow we are making CPython faster. Past, present and future.
24mRestarting Pyjion, a general purpose JIT for Python- is it worth it?
48mPython Performance: Past, Present and Future
22mPyPy and the future of the Python ecosystem
