Building a JIT compiler for CPython
summary
Prototype JIT for CPython uses copy-and-patch to splice precompiled machine-code templates into executable memory at build time, with generated micro-op translations and small runtime C glue. The pipeline compiles instruction bodies ahead-of-time, patches runtime operands, and removes guards so the experimental JIT in 3.13 overcomes the ~20% slowdown introduced by the micro-op interpreter and currently costs about +10% memory while remaining optional and broadly portable under Faster CPython with micro op traces.
AI-written summary · about
chapters (9)
- 0:00JIT compiler project intro
- 1:07CPython performance background
- 3:57Micro-op traces optimization
- 10:39Why JIT now
- 12:20JIT design goals and constraints
- 15:51Copy-and-patch technique
- 23:59Implementation complexity and platforms
- 26:26Performance results and plans
- 28:33Build and try the JIT
related talks
29mWhat they don't tell you about building a JIT compiler for CPython
01h 03mA tour of CPython's runtime
41mHow to write a JIT compiler in 30 minutes
17mInside a PyPy JIT: is that even legal?
25mHow two teams are working together to make Python better for all
22mPyPy and the future of the Python ecosystem
48mPython Performance: Past, Present and Future
24mRestarting Pyjion, a general purpose JIT for Python- is it worth it?
