HackerTube
HomeLongsLikedHistoryWatch laterCategoriesPlaylistsSettings

Brandt Bucher – A JIT Compiler for CPython

encukou1 HN recommender · recommended in 1 month, 2023-2024
YouTube
14K views · 2 years ago · talk · dated

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.

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

Compilers, interpreters & program analysisPython, Ruby & scripting languagesSoftware performance & optimization#cpython#jit#copy-and-patch#pythoninternals#performance

3 comments from Hacker News

@Qem2024 · in “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 ▶ this video

CitesView on HN
@vanderZwan2024 · in “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 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 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 LLVM. Case in point: as of the talk this was all just Brandt Bucher's work. The implementation at the time was ~700 lines of "complex" Python, ~100 lines of "complex" C, plus of course the LLVM dependency. This produces ~3000 lines of "simple" generated C, requires an additional ~300 lines of "simple" hand-written C to come together, and no further dependencies (so no LLVM necessary to run the JIT. Also "complex" and "simple" qualifiers are Bucher's terms, not mine). Another thing to note is that these initial performance improvements are just from getting this first version of the copy-and-patch JIT to work at all , without really doing any further fine-tuning or optimization. This may have changed a bit in the months since, but the situation is probably still comparable. So if one person

Strongly recommendsView on HN
@acqq2023 · in “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. ▶ this video Slides (pg. 31 performance): link

CitesView on HN
Let's prototype a JavaScript JIT compiler!1:21:25

Let's prototype a JavaScript JIT compiler!

Andreas Kling
49K views • 3 years ago
Building Your Own Dynamic Language1:14:32

Building Your Own Dynamic Language

Stanford
21K views • 18 years ago
Demo: Base language, compile-time execution2:07:18

Demo: Base language, compile-time execution

Jonathan Blow
164K views • 12 years ago
Compiling and Optimizing Scripting Languages1:01:37

Compiling and Optimizing Scripting Languages

Google TechTalks
21K views • 17 years ago
CppCon 2017: Matt Godbolt “What Has My Compiler Done for Me Lately? Unbolting the Compiler's Lid”1:15:46

CppCon 2017: Matt Godbolt “What Has My Compiler Done for Me Lately? Unbolting the Compiler's Lid”

CppCon
178K views • 9 years ago
Chris Seaton @ VMSS16: JRuby+Truffle: Why it’s Important to Optimise the Tricky Parts1:02:44

Chris Seaton @ VMSS16: JRuby+Truffle: Why it’s Important to Optimise the Tricky Parts

softdevteamuk
5K views • 10 years ago
C++Now 2018: Matt Godbolt “What Else Has My Compiler Done For Me Lately?”1:30:03

C++Now 2018: Matt Godbolt “What Else Has My Compiler Done For Me Lately?”

CppNow
11K views • 8 years ago
Cliff Click @ VMSS16: Bits of Advice For the VM Writer1:15:09

Cliff Click @ VMSS16: Bits of Advice For the VM Writer

softdevteamuk
4K views • 10 years ago
How Python was Shaped by leaky Internals, Armin Ronacher, Flask framework49:55

How Python was Shaped by leaky Internals, Armin Ronacher, Flask framework

Видео с мероприятий {speach!
20K views • 10 years ago
Episode 1: A basic expression evaluator1:38:36

Episode 1: A basic expression evaluator

Immo Landwerth (terrajobst)
284K views • 8 years ago
Modernizing Compiler Design for Carbon Toolchain - Chandler Carruth - CppNow 20231:35:12

Modernizing Compiler Design for Carbon Toolchain - Chandler Carruth - CppNow 2023

CppNow
71K views • 3 years ago
CppCon 2019: Matt Godbolt “Compiler Explorer: Behind The Scenes”1:00:21

CppCon 2019: Matt Godbolt “Compiler Explorer: Behind The Scenes”

CppCon
29K views • 7 years ago
Twitter’s Quest for a Wholly Graal Runtime by Chris Thalinger50:11

Twitter’s Quest for a Wholly Graal Runtime by Chris Thalinger

Scala Days Conferences
3K views • 8 years ago
Java on a 1000 Cores - Tales of Hardware / Software CoDesign1:12:02

Java on a 1000 Cores - Tales of Hardware / Software CoDesign

Google TechTalks
23K views • 17 years ago
Dmitry Vyukov — Go scheduler: Implementing language with lightweight concurrency1:00:40

Dmitry Vyukov — Go scheduler: Implementing language with lightweight concurrency

Hydra
47K views • 7 years ago
2013 Keynote: Chandler Carruth: Optimizing the Emergent Structures of C++1:33:02

2013 Keynote: Chandler Carruth: Optimizing the Emergent Structures of C++

CppNow
34K views • 13 years ago
A 10x faster TypeScript13:45

A 10x faster TypeScript

Microsoft Developer
608K views • 1 year ago
Bruce Hauman - Developing ClojureScript With Figwheel45:31

Bruce Hauman - Developing ClojureScript With Figwheel

ClojureTV
56K views • 11 years ago
Can C++ be 10x Simpler & Safer?  - Herb Sutter - CppCon 20221:54:00

Can C++ be 10x Simpler & Safer? - Herb Sutter - CppCon 2022

CppCon
277K views • 3 years ago
Armin Ronacher - A Python for Future Generations42:44

Armin Ronacher - A Python for Future Generations

EuroPython Conference
6K views • 9 years ago