Async Techniques and Examples in Python Transcripts
Chapter: Parallelism in C with Cython
Lecture: C and Python are friends

Login or purchase this course to watch this video and the rest of the course contents.
0:00 When you talk about Python in performance it's really interesting because Python code itself is kind of slow compared to languages like
0:10 C#, Java, definitely C++, things like that. So, you say well this code is slow. But you can actually write a whole bunch more functionality
0:19 with way fewer bugs really quickly. And then you can try to make it faster. A lot of the stuff we talked about with parallelism
0:25 it lets us do many things faster and if you're waiting on other systems, perfect. Maybe though, you're working with something computational.
0:32 You might bring in some library like NumPy for data science or numerical computations. And that really mixes up the performance
0:39 because the internals in NumPy are written in C. And it's highly optimized. So, maybe you're version written in C
0:46 would actually be slower than Python's version using NumPy. I don't know. This is a hypothetical, right? Another way to think about this is
0:53 certain parts of your Python code are really critical and most of them aren't. So, if you think about SQLAlchemy there's a little tiny internal bit
1:03 that is written in C that goes really, really fast and then the rest of it you'd do in Python. But that's not the slow part.
1:10 The slow part is actually not in Python, its in C. So, this Python, C integration is really interesting and really important.
1:18 Now, you may be thinking, Micheal. I either don't know C or C++ or I hate working in C and C++ that's why I'm a Python developer.
1:26 Fine, I'm with you. It's been a long time since I been a professional C++ developer. A really long time. What we're going to talk about here
1:33 is actually how we can take advantage of this performance and integration that we get with Python's great compatibility with C
1:40 without actually writing any C code at all. Sounds perfect doesn't it?


Talk Python's Mastodon Michael Kennedy's Mastodon