Async Techniques and Examples in Python Transcripts
Chapter: Parallelism in C with Cython
Lecture: Python async landscape: Cython

Login or purchase this course to watch this video and the rest of the course contents.
0:00 It's time to take a different perspective on performance and parallelism inside of Python. So far, what we've done is we've stayed entirely
0:09 focused on our Python code in the constructs within there Asyncio, threading, multiprocessing and so on
0:17 to add parallelism. And, that's a really good place to be. I would recommend you spend most of your energy and time there.
0:25 It turns out we can also integrate with extra libraries especially in C, and as you probably know C can do anything.
0:33 Our operating systems are generally written in C so C is super low-level these days and is very very good at performance and parallelism.
0:43 So there might be reasons to think about writing C code and integrating that with our program. So, here we are and do things faster.
0:53 This has two factors that multiply your performance in really interesting ways. One, even if we don't do any parallelism
1:01 you'll see that converting certain parts of our program to C will make it go way, way faster. You'll also see that we can escape the Gil in C
1:12 which means that we can go even faster. So we can do basically what we do with multiprocessing but in a single process and do that faster as well.
1:20 So there's this double multiplying effect of our performance. It's not that I would say jump at first
1:26 but if you have any really performance critical system you might think about some of the techniques in this chapter.


Talk Python's Mastodon Michael Kennedy's Mastodon