Brandt Bucher – A JIT Compiler for CPython

Channel:encukou · Length:47:50 · Published:2023-11-15 · Views:14098

Watch on YouTube

Summary

Brandt Bucher presents his prototype JIT compiler for CPython at the 2023 Core Developer Sprint. He explains the copy-and-patch approach, the implementation and its performance.

Why HN recommends it

It is the go-to explanation of how CPython's JIT works and why its design is so simple.

I recommend that people watch Brandt Bucher's "A JIT Compiler for CPython" from last year's CPython Core Developer Sprint[0]. — HN, 2024

Python, Ruby & scripting languages · Software performance & optimization · Compilers, interpreters & program analysis

Subtitles (excerpt)

All right, it's time! Here's Brandt with his talk! [applause] [Brandt] All right, so, instead of giving this talk tomorrow… By the way, can everyone hear me? Okay, cool. So, instead of giving this talk tomorrow I'm giving it today. I'm going to be sharing a little bit about something I have been thinking quite a bit about for last few months which is what Python's future JIT compiler might look like. Or, CPython's future JIT compiler, specifically. So I'm going to start with some background and this will also be good background for Ken's talk immediately after this, on optimizations that we hope to perform. Specifically, I'm mostly going to be talking about some experiments that I've done with actually generating and executing machine code, not necessarily optimizations and things that happen in the meantime. However, I will be giving some background on that because I think it's really helpful for understanding how everything ties together. So, a little recent history: In CPython 3.11, one of the headline features was the specializing adaptive interpreter. This delivered really good speedups; I think the number we quoted most widely was something like 25%. If you want to take that at face value, that

On Hacker News

You're right, and in this case "foundational work" even undersells how minimal this work really is compared to the results it already gets. I recommend that people watch Brandt Bucher's "A JIT Compiler for CPython" from last year's CPython Core Developer Sprint[0]. It gives a good impression of the current implementation and its limitations, and some hints at what may or may not work out. It also… — vanderZwan, 2024-01
Yes. This is the algorithm chosen for the CPython JIT under development, scheduled for inclusion from 3.13 onwards. See [VIDEO] — Qem, 2024-06
"Only 35% slower overall than LuaJIT" as per video from a month ago. No idea which kind of tests are these "overall" though. [VIDEO] Slides (pg. 31 performance): [LINK] — acqq, 2023-12

Related videos