Skip to content
0:00 / 0:00

#cpython#jit#copy-and-patch

Brandt Bucher – A JIT Compiler for CPython

encukou

589 subscribers • 1 video on Hallway

YouTube

Advanced. Deep dive for people who know the field.

14K views2 years ago2 recommendations

Programming languagesSystems programmingPythonCompilers and interpretersPerformance and optimization

Brandt Bucher presents a prototype JIT compiler for CPython using a copy-and-patch compilation approach.

From the 2023 CPython Core Developer Sprint The QA section is hard to understand; turn on subtitles for our best-effort transcription. (PRs welcome: github.com/encukou/subtitles-for-brandts-talk/blob/main/jit.…) Links & bibliography: Slides: github.com/brandtbucher/brandtbucher/blob/master/2023/10/10/… GitHub branch: github.com/brandtbucher/cpython/tree/justin Haoran Xu and Fredrik Kjolstad. 2021. Copy-and-patch compilation: a fast compilation algorithm for high-level languages and bytecode. Proceedings of the ACM on Programming Languages 5, OOPSLA (2021). doi.org/10.1145/3485513 Haoran Xu. 2023. Building a baseline JIT for Lua automatically. (12 March 2023). Retrieved from sillycross.github.io/2023/05/12/2023-05-12/

Why it's here

2 people recommend this

What people say. Recommended for understanding the design, implementation, and performance of the copy-and-patch JIT compiler introduced in Python 3.13.

u/mttdin r/Compilers • Recommends

A JIT Compiler for CPython using Copy-and-Patch - Brandt Bucher

vanderZwanon Hacker News • Recommends

On “Python 3.13 Gets a JIT”

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 Sprint0. 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 indirectly gives a glimpse into the process of getting this into Python through the exchanges during the Q&A discussion. One thing to especially highlight is that this copy-and-patch has a much, much lower implementation complexity for the maintainers, as a lot of the heavy lifting is offloaded to L…

acqqon Hacker News • Mentions

On “What's up Python? Epic CPython commit, Django 5 and 2FA for PyPI”

"Only 35% slower overall than LuaJIT" as per video from a month ago. No idea which kind of tests are these "overall" though. link to this video Slides (pg. 31 performance): link

Qemon Hacker News • Mentions

On “Copy-and-Patch: Fast compilation for high-level languages and bytecode (2020)”

Yes. This is the algorithm chosen for the CPython JIT under development, scheduled for inclusion from 3.13 onwards. See link to this video