Latest / Talk Python To Me / #339: Making Python Faster with Guido and Mark
Transcript
- 0:00There's been a bunch of renewed interest in making Python faster. While for some of us,
- 0:04Python is already plenty fast, for others, such as those in data science, scientific computing,
- 0:09and even large tech companies, making Python even a little faster would be a big deal.
- 0:13This episode is the first of several that dive into some of the active efforts to increase the
- 0:20speed of Python while maintaining compatibility with existing code and packages. And who better
- 0:25to help kick this off than Guido van Rossum and Mark Shannon. They both joined us to share their
- 0:30project to make Python faster. I'm sure you'll love hearing about what they're up to.
- 0:34This is Talk Python To Me, episode 339, recorded November 1st, 2021.
- 0:54Welcome to Talk Python To Me, a weekly podcast on Python. This is your host, Michael Kennedy.
- 0:59Follow me on Twitter where I'm @mkennedy, and keep up with the show and listen to past
- 1:03episodes at talkpython.fm. And follow the show on Twitter via at Talk Python. We've started streaming
- 1:09most of our episodes live on YouTube. Subscribe to our YouTube channel over at talkpython.fm slash
- 1:15YouTube to get notified about upcoming shows and be part of that episode. This episode is brought to
- 1:21you by Shortcut and Linode, and the transcripts are sponsored by Assembly AI.
- 1:26Mark Guido, welcome to Talk Python To Me. Fantastic to have you here. I'm so excited about all the
- 1:35things that are happening around Python performance. I feel like there's just a bunch of new ideas
- 1:40springing up and people working on it, and it's exciting times.
- 1:43Definitely. You two are, of course, right at the center of it. But before we talk
- 1:48about the performance work that you are all doing, as well as some of the other initiatives going along,
- 1:53maybe in parallel there, let's just get started with a little bit of background on you. Guido,
- 1:58you've been on the show before, creator of Python. You hardly need an introduction to most people out
- 2:03there. But you have recently made a couple of big changes in your life. I thought I'd just ask you how
- 2:08that's going. You retired, and we were all super happy for you on that. And then you said, you know
- 2:13what, I kind of want to play with code some more. And now you're at Microsoft. What's the story there?
- 2:17Oh, I just like the idea of retiring. So I try to see how many times in a lifetime I can retire.
- 2:23And starting with my retirement from BDFL didn't stop me from staying super active in the community.
- 2:30But when I retired from Dropbox a little over two years ago, I really thought that that was it,
- 2:36that I believed it. And everybody else believed it too. Dropbox certainly believed it. They were very
- 2:43sad to see me go. I was sad to go, but I thought there was time. And I had a few great months decompressing,
- 2:52going on bike rides with my wife and family, fun stuff. And then the pandemic hit.
- 2:59Yeah.
- 2:59And a bunch of things got harder. Fortunately, the bike rides eventually got restored. But
- 3:05other activities like eating out was a lot more stressful. Basically, just life was a lot more
- 3:11stressful in general.
- 3:12Right. And the human interaction was definitely shrunken down to a kernel.
- 3:16Yeah. And somehow I thought, well, I want to have something to do. I want to do more sort of
- 3:25software development in a team. And the Python core development team didn't really cut it for me,
- 3:30because it's sort of diffuse and volunteer based. And sometimes you get stuck waiting for months for
- 3:37the steering council to sort of approve of or reject a certain idea that you've worked on.
- 3:45So I asked around and I found that Microsoft was super interested in hiring me. And that was now,
- 3:52well, tomorrow, exactly a month, a year, tomorrow, a year ago, I started at Microsoft officially.
- 3:58Yeah.
- 3:59In the beginning, I just had to find my way around at Microsoft. Eventually, I figured I should pick a
- 4:06project. And after looking around and realizing I couldn't really sort of turn the world of machine
- 4:13learning upside down, I figured I'd stay closer to home and see if Microsoft was interested in funding
- 4:19a team working on speeding up CPython. And I was actually inspired by Mark's proposals that were
- 4:27going around at the time. So I convinced people, Microsoft to sort of start a small team and get Mark on board.
- 4:35Yeah, that's fantastic. I also feel a little bit like machine learning is amazing, but I don't have a lot of
- 4:41experience with it. And whenever I work with it, I always kind of feel on the outside of it. But this core
- 4:47performance of Python, that helps everybody, right? Including even Microsoft, right? It maybe saves them
- 4:53Oh, absolutely.
- 4:54energy on Azure when they're running Python workloads or whatever. So you're enjoying your time? You're happy you're there?
- 5:00I'm very happy.
- 5:00Yeah, yeah, a lot of freedom to basically pursue what you are, right?
- 5:05Yeah, it's nice that the new Microsoft is very open source friendly, at least in many cases, obviously,
- 5:10not everywhere. But our department is very open source friendly. Things like Visual Studio Code are all open source. And so there was great support with management for sort of the way I said, I wanted to do this project, which is completely out in the open. Everything we do is sort of just merged into main as soon as we can.
- 5:33Yeah, we work with the core developers. We don't have like a private fork of Python, where we do amazing stuff. And then we knock on the steering council door and say, Hey, we'd like to merge this.
- 5:47Yeah, you're not going to drop six months of work just in one block, right? It's there for everyone to see.
- 5:53Exactly.
- 5:54I think that's really, really positive. And wow, what a change, not just for Microsoft, but so many companies to work that way compared to 10, 15 years ago.
- 6:03Yeah, absolutely. Now, before I get to Mark, I just want to, you know, some bunch of people are excited that you're here. And Luis out in the audience said, Wow, it's Guido. I can't thank you enough for your amazing Python and all the community.
- 6:17Great to hear.
- 6:17Mark, how about you? How'd you get into this Python performance thing? I know you did some stuff with Hot Pie back in the day.
- 6:24Yeah, that was sort of my PhD work. So I guess I kind of go into the performance almost before the Python. So I was doing sort of compiler work, masters. And obviously, just, you know, you need to write scripts and just get stuff done. And, you know, just Python is just a language to get stuff done. And then it's that, I think Armin Rigo, sort of, I think one of his sort of credits in one of his papers or something says,
- 6:52Thank you for Python for being such a great language to use and such a challenge to optimize. So it's doubly good if you're coming at it from a sort of it. So it provides this great intellectual challenge when you're actually trying to optimize it. And it's a really nice language to use as well. So it's doubly good.
- 7:07It is doubly good. It's doubly good. Yeah. And before we move on really quick, Paul Everitt says, It's really impressive how the in the open work has been done. Yeah, totally agree.
- 7:16Hi, Paul.
- 7:17Yeah, keep that going. Hey, Paul, happy to see you here.
- 7:19We're going to talk about making Python faster. But I want to start this conversation, a bit of a hypothetical question, but sort of set the stage and ask, how much does Python really need to be faster?
- 7:31Because on one hand, sure, there's a lot more performance we can do if you're going to say, well, we're going to solve the in-body problem using C++ or C# versus Python. It's going to be faster with the native value types and whatnot.
- 7:44On the other, people are building amazing software that runs really fast with Python already. We've got the C optimizations for things like NumPy and SQLAlchemy's transformation layer, serialization layer, and so on. So a lot of times that kind of brings it back to C performance. So how much do you think Python really needs to be optimized already? Not that more is always better, faster is always better. But I just kind of want to set the stage and get your two thoughts on that.
- 8:11I always think back to my experience at Dropbox, where there was a large server called the Meta
- 8:19Server, which did sort of all the server side work, like anything that hits www.dropbox.com
- 8:27hits that server. And that server was initially a small prototype written in Python, the client was
- 8:34actually also a small prototype written in Python. And to this day, both the server and the client
- 8:40at Dropbox, as far as I know, and unless in the last two years, they totally ripped it apart,
- 8:45but I don't think they did. They tweaked it, but it's still all now very large Python applications.
- 8:51And so Dropbox really sort of feels the speed of Python in its budget, because they have thousands,
- 9:02I don't know how many thousands of machines that all run this enormous Python application.
- 9:08Right. And if it was four times faster, that's
- 9:10not just for, you know, a quarter of the machines, that's less DevOps, less admin,
- 9:15all sorts of stuff, right?
- 9:16Oh, even if it was 4% faster, they would notice.
- 9:19Yeah. The other area where I think it's really relevant has to do with the multi-core side of
- 9:26things. I have a PC over there, 16 cores. My new laptop has 10 cores. Although with Python,
- 9:32it's hard to take true advantage of that side of modern CPU performance if it's not IO bound,
- 9:38right? Yeah. I don't know how deep you want me to go into that and Mark can stop me if I'm going too deep
- 9:44too, but there are existing patterns that work reasonably well. If you have a server application
- 9:52that handles multiple fairly independent requests. Like if you're building a multi-core web application,
- 10:00you can use multi-processing or pre-forking or a variety of ways of running a Python interpreter on
- 10:08each core that you have, each independently handling requests. And you can do that if you have 64 cores,
- 10:15you run 64 Python processes.
- 10:18Right. That's just a number in a microwave config file. It's nothing.
- 10:21Yeah. It works for applications that are designed to sort of handle multiple independent requests in a scalable fashion.
- 10:31There are other things that the other algorithms that you would want to execute where it's much more complicated to,
- 10:38to sort of employ all your cores efficiently.
- 10:42Yeah, absolutely.
- 10:43That's still a nut that Python hasn't cracked. And I'm assuming you're asking this question because Sam Gross,
- 10:50a very smart developer at Facebook, claims that he has cracked it.
- 10:54Perhaps he has. It's an interesting idea. We'll dive into that a little bit later.
- 10:58I'm more asking it just because I see a lot of people say that Python is too slow. And then I also see
- 11:04a lot of people being very successful with it and it not being slow in practice or not being much slower
- 11:11than other things. And so I'm more or less at the stage of like the context matters, right? This Dropbox example
- 11:17you have, it really matters to them. You know, my course website where people take courses,
- 11:22the response time of the pages is 40 milliseconds. If it was 38, it doesn't matter. It's really fast.
- 11:28It's fine. So I think, but if I was trying to do computational biology in Python, we really want
- 11:33to be able to take advantage of those 16 cores, right? So there's just such a variety of perspectives
- 11:39where it matters. Mark, what are your thoughts on all this?
- 11:41Well, it's just a case of saving energy, saving time. It just makes the whole thing nicer to use.
- 11:47So, I mean, there's a lot of, you know, just iterative development in data science
- 11:52and it's that responsiveness, the whole, you know, just breaking your train of thought
- 11:57because things take too long versus just keeping in the flow and all that sort of stuff.
- 12:01It's just nice to have something that's faster. I mean, it's not just the big companies saving
- 12:06money as well. I mean, it's just, you know, just keeps everyone's server budgets down. I mean,
- 12:09if you just need a smaller virtual instance, because you can serve the requests up fast enough
- 12:14because Python's faster. So I think it's just generally a sort of responsible thing to do.
- 12:20I mean, it's also just, you know, people expect technology to move forwards and there's this
- 12:25feeling of, you know, falling behind or, you know, people wanting to move other languages because of
- 12:30the perceived performance.
- 12:31I do think that that's an issue. You know, I'm moving to go because it has better async support,
- 12:35rewriting this in Rust for whatever reason. Sometimes that might make sense, but other times
- 12:39I feel like that's just a shame and it could be used better. A couple of questions from the audience
- 12:43just want to throw out there. Let's see. One was Guido, especially, you must be really proud to hear
- 12:50about the Mars helicopter and the lander and Python in space. You know, how did you feel when you heard
- 12:56about the helicopter using Python and the lander using Python and Flask and things like that?
- 13:01It wasn't really a surprise given how popular Python is amongst scientists. So I didn't throw a
- 13:09party, but it made me feel good. I mean, it's definitely sort of one of those accomplishments
- 13:14for a piece of technology. If it's actually shot into space, you know, you've made a difference.
- 13:21Yeah. I remember like 30 years ago or more when I helped some coding on European project called
- 13:29Amoeba, which was like a little distributed operating system. And one of the things that
- 13:34they always boasted was that our software runs on the European space station. And that was very important.
- 13:40Yeah. So yeah, I totally get the feeling. And then I hope that everyone who contributed to Python
- 13:45also sort of feels that their contribution has made it.
- 13:50Yeah. And that sense of awe, if you look up in the night sky, it's that little,
- 13:53that bright star that's actually Mars. And you think, yeah, it's up there. Yeah. Fantastic. All right.
- 13:58Let's dive into some of the performance stuff that you all have been doing. So maybe Guido starts out
- 14:04with the team. So you've, you've got a group of folks working together. It's not just you. And also now
- 14:09Mark Shannon is working with you as well, right? That's correct. In March or so, the initial team
- 14:15was Eric Snow, Mark and myself. And since I think since early October, we've got fourth team member,
- 14:23Brent Booker, who is also a Python core dev since, I think since about a year and a half. He's a really
- 14:30smart guy. So now we have four people, except you should really discount me as a team member because I
- 14:36spend most of my time in meetings, either with a team or with other things going on at Microsoft in practice.
- 14:44Sure. How closely do you work with, say, the VS Code Python plugin team and other parts? Or is this more
- 14:50a focused effort?
- 14:51This is more focused. I know those people. I've not met anyone in person, of course. I've not met,
- 14:57I've not been to a Microsoft office since I started there, which is really crazy. But what we're doing
- 15:04is really quite separate from other sort of Python related projects at Microsoft. But I sort of,
- 15:11I do get called into meetings to give my opinion or sort of what I know about how the community is
- 15:17feeling or how the core dev team is feeling about various things that are interesting to Microsoft or
- 15:24sometimes things that management is concerned about.
- 15:27Yeah. Excellent.
- 15:28I'd be worth saying this, not just Microsoft as well. We've contributed from,
- 15:32there's quite a few other core developers are helping out. So it's a broader effort.
- 15:38This portion of Talk Python To Me is brought to you by Shortcut, formerly known as clubhouse.io. Happy
- 15:44with your project management tool? Most tools are either too simple for a growing engineering team
- 15:49to manage everything, or way too complex for anyone to want to use them without constant prodding.
- 15:54Shortcut is different though, because it's worse. No, wait, no, I mean, it's better.
- 15:58Shortcut is project management built specifically for software teams. It's fast, intuitive, flexible,
- 16:04powerful, and many other nice positive adjectives. Key features include team-based workflows.
- 16:10Individual teams can use default workflows or customize them to match the way they work.
- 16:15Org-wide goals and roadmaps. The work in these workflows is automatically tied into larger company
- 16:20goals. It takes one click to move from a roadmap to a team's work to individual updates and back.
- 16:26Tight version control integration. Whether you use GitHub, GitLab, or Bitbucket, clubhouse ties
- 16:31directly into them so you can update progress from the command line.
- 16:35Keyboard-friendly interface. The rest of Shortcut is just as friendly as their power bar,
- 16:40allowing you to do virtually anything without touching your mouse. Throw that thing in the trash.
- 16:45Iteration planning. Set weekly priorities and let Shortcut run the schedule for you with
- 16:50accompanying burndown charts and other reporting. Give it a try over at talkpython.fm/shortcut. Again,
- 16:58that's talkpython.fm/shortcut. Choose shortcut because you shouldn't have to project manage your
- 17:05project management. Mark, what's your role on the team?
- 17:09I know we already have sort of official roles, but I guess I'm sort of doing a fair bit of
- 17:15sort of technical, sort of architectural side of stuff, obviously, because this is like my field.
- 17:19So right. Optimizer in chief. Yeah, I guess so. All right. Guido, you gave a talk at the Python
- 17:26Language Summit in May this year, talking about faster Python, this team, some of the work that
- 17:31you're doing. So I thought that might be a good place to start the conversation.
- 17:35Yeah. Some of the content there is a little outdated, but...
- 17:37Well, you just have to let me know when things have changed. So one of the questions you ask is,
- 17:44can we make CPython specifically faster? And I think that's also worth pointing out, right? There's many
- 17:49runtimes. Often they're called interpreters. I prefer to the runtime word because sometimes they compile and
- 17:55they don't interpret. So...
- 17:56Sometimes they're called virtual machines.
- 17:58Yeah. There's many Python virtual machines, PyPy, CPython. Traditionally, there's been Jython and
- 18:06Iron Python, although I don't know if they're doing anything. But your focus and your energy is about
- 18:11how do we make the Python people get if they just go to their terminal and type Python, the main Python
- 18:16faster? Because that's what people are using, right? For the most part.
- 18:19I don't have specific numbers or sources, but I believe that like between 95 and 99% of people using
- 18:27Python are using some version of CPython. Hopefully not too many of them are still using Python too.
- 18:32Yeah. I would totally agree with that. And I would think it would trend more towards the 99 and less
- 18:37towards the 95 for sure. Maybe a fork of CPython that they've done something weird too. But yeah,
- 18:42I would say CPython. So you asked the question, can we speed up CPython? And Teddy out in the live
- 18:48stream, I don't know if I'll be able to catch his comment exactly how there is. He says, you know,
- 18:52what will we lose in making Python faster if anything? For example, what are the trade-offs?
- 18:56So you point out, well, can we make it two times faster, 10 times faster, and then without breaking
- 19:01anybody's code, right? Because I think we just went through a two to three type of thing that was way
- 19:06more drawn out than I feel like it should have been. We don't want to reset that again, do we?
- 19:11No. Well, obviously the numbers on this slide are just teasers.
- 19:15Of course. I don't know how to do it. I think Mark has a plan, but that doesn't necessarily mean he knows
- 19:21how to do it exactly either. The key thing is, and sort of to answer your audience question without
- 19:28breaking on anybody's code. So we're really trying to sort of not have there be any downsides to adopting
- 19:36this new version of Python, which is unusual because definitely if you use PyPy, which is,
- 19:45I think, the only sort of competitor that competes on speed that is still alive, and in some use,
- 19:52you pay in terms of how well does it work with extension modules. It doesn't work with all extension modules.
- 20:00And with some extension modules, it works, but it's slower. There are various limitations. And that in particular
- 20:08is something that has kept many similar attempts back.
- 20:13If we just give this up, we can have X, Y, and Z, right? But that those turn out to be pretty big compromises.
- 20:19Absolutely. And sometimes, I mean, quite often extension modules are the issue. Sometimes there are also
- 20:25things where Python's runtime semantics are not fully specified. Like, it's not defined by the language
- 20:33when exactly objects are finalized when they go out of scope. In practice, there's a lot of code around
- 20:41there that in very subtle ways depends on CPython's finalization semantics based on reference counting.
- 20:48And so anything, and this is also something that PyPy learned, and I think,
- 20:53oh, Piston, which is definitely alive and open source. You should talk to the Piston guys if you
- 20:59haven't already. But their first version, which they developed many years ago at Dropbox, suffered from
- 21:06sort of imprecise finalization semantics. And they found with sort of early tests on the Dropbox server code
- 21:15that there was too much behavior that didn't work right because objects weren't always finalized at the
- 21:23same time or sometimes in the same order as they were in standard CPython.
- 21:28Oh, interesting. So there's no promises about that, right? It just says, well, when you're done with it,
- 21:33it goes away pretty much eventually. If it's a reference count, it might go away quickly. If it's a cycle,
- 21:38it might go away slower.
- 21:39That's correct. And unfortunately, this is one of those unspecified parts of the language where people
- 21:46in practice all depend on, not everybody, obviously, but many large production code bases do end up
- 21:54depending on that. Not sort of intentionally. It's not that a bunch of application architects got together
- 22:01and said, we're going to depend on precise finalization based on reference counting. It's more that those
- 22:08servers, like the 5 million lines of server code that Dropbox had when I left, were written by hundreds of
- 22:15different engineers, some of whom wrote only one function or two lines of code, some of whom sort of maintained
- 22:23several entire subsystems for years. But collectively, it's a very large number of people who don't
- 22:29all have the same understanding of how Python works and which part is part of the sort of the promises
- 22:35of the language and which is just sort of how the implementation happens to work. And some of those
- 22:42are pretty obvious. I mean, sometimes there are functions where the documentation says,
- 22:47well, you can use this, but it's not guaranteed that this function exists or that it always behaves the
- 22:53same way. But the sort of the finalization behavior is pretty implicit.
- 22:57Yeah, Mark, what are your thoughts here?
- 22:58People just expectations is derived from what they use. The problem with documentation is like
- 23:03instructions. They don't always get read. And also, it's not just finalization. It's also reclaiming
- 23:08memory. So anything that has a different memory management system might just need more memory.
- 23:15Reference counting is pretty good at reclaiming memory quickly and will run near the limit of what you
- 23:20have available. Whereas a sort of more tracing garbage collector like PyPy doesn't always work so well like
- 23:25that. I mean, one thing we are going to change is the performance characteristics. Now, that should
- 23:29generally be a good thing, but there may be people who rely on more consistent performance.
- 23:35You may end up unearthing race conditions, potentially that no one really knew was there. I mean,
- 23:40but I would not blame you for making Python faster and people who write bad, poorly threads of code
- 23:46fall into some trap there. But I guess that there's even those kinds of unintended consequences, I guess.
- 23:51That one sounds like pretty low risk, to be honest. Yeah.
- 23:54Yeah. Also, this sort of the warm up time, we'll get a warm up time. Now, what will happen is,
- 23:59of course, it's just getting faster. So it's no slower to start with. But it still has the perception
- 24:04that that now takes a while to get up to speed, whereas previously, it used to get up to speed very
- 24:08quickly, because it didn't really get up to speed. It just started. It stays around. It stayed at the same
- 24:13speeds. But these are subtle things, but they're detectable changes that people may notice.
- 24:18Yeah. Also, like any optimizer, there are certain situations where the optimization doesn't really
- 24:25work. It's not necessarily a pessimization, but somehow it's not any faster than previous versions.
- 24:32Well, other similar code may run much faster. And so you have this strange effect that you make a small
- 24:40tweak to your code, which you think should not affect performance at all. Or you're not aware that
- 24:47suddenly you've made that part of your code 20% slower.
- 24:50Yeah. It is one of our design goals not to have these surprising sort of performance edges. But
- 24:56but yeah, there's a little cases where it might definitely make a difference. Things will get a
- 24:59bit slower. Yeah. There are very subtle things that can have huge performance differences that
- 25:05I think people who are newer to Python run into like, oh, I see you can do this comprehension. And I had
- 25:11square brackets, but I saw they had parentheses. So that's the same thing, right? Well,
- 25:16not so much, not so much. Not if it's a million lines of code or a million lines of data. All right.
- 25:22So that's a great way to think about it. Not making it break a lot of code is I think as much as it's
- 25:28exciting to think about completely reinventing it, it's super important that we just have a lot of
- 25:32consistency now that we've kind of just moved beyond the Python two versus three type of thing.
- 25:37I think also it's worth mentioning, Guido, you gave a shout out to Sam Gross's proposal. The stuff you're
- 25:43doing is not Sam Gross's proposal. It's not about even from what I can see from the outside that much
- 25:48about threading. It's more about how do I make just the fundamental stuff of Python go faster. Is that right?
- 25:54That's right. These are like completely different developments. When we started this, we didn't
- 25:59actually know Sam or that there was anyone who was working on something like that. But there had
- 26:06been previous attempts to remove the gill, which is what Sam has done. And like the most recent one of
- 26:13those was by Larry Hastings, who came up with the great name, the gillectomy. That's a fantastic name.
- 26:19Yeah. He put a lot of time in it, but in the end he had to give up because the sort of the baseline
- 26:27performance was just significantly slower than vanilla interpreter. And I believe it also didn't scale all
- 26:35that well. Although I don't remember whether it sort of stopped scaling at five or 10 or 20 cores,
- 26:43but right. Yeah.
- 26:43Sam claims that he's sort of got the baseline performance, I think within 10% or so of vanilla
- 26:513.9, which is what he's worked off. Right.
- 26:54And he also claims that he has a very scalable solution and he obviously put much more effort in it,
- 27:00much more time in it than Larry ever had.
- 27:03Yeah. And it sounds like Facebook
- 27:04is putting some effort into funding his work on that, which is great.
- 27:08Yeah. But it feels like a very sort of bottom up project. It feels like
- 27:12Yeah.
- 27:13Sam thought that that this was an interesting challenge and he sort of convinced himself that he could do it.
- 27:19And he sort of gradually worked on all the different problems that he encountered on the way.
- 27:25And he convinced his manager that this was a good use of his time. It's my theory, because that's usually how these projects go. But you almost never have management say, Oh, we got to fund an engineer to make faster or make a multi-core or whatever.
- 27:43Find a good engineer.
- 27:48Yeah. So you all are adopting what I see is going as the Shannon plan. As in Mark Shannon, the guests in the top left here. That's fantastic. I remember talking about this as well, that you had hosted this thing. When was this back? A little over a year ago. So interesting time in there, right? You had talked about making Python faster.
- 28:16You had talked about Python faster over the next four releases by a factor of five, which is pretty awesome. And you have a concrete plan to sort of make changes along each yearly release to add a little bit of performance because the geometric growth may get quite a bit faster over time.
- 28:31Yeah. Do you want me to run through these?
- 28:33Yeah. Yeah. Tell us about your plan. You've got four stages and maybe we could talk through each stage and focus in on some of the tech there.
- 28:39The way we're implementing is now kind of a bit of a jumble of stage one and two, but the basic idea is that, dynamic languages, the key performance improvement is always based on specialization. So obviously, you know, it's the most of the time the code does mostly the same thing as it did last time.
- 28:57Yeah. And even in like non loopy code, you know, who are web server, there's still like a big loop level at sort of like requests response on a level. So you're still hitting the same sort of code. And those codes are doing much the same sort of thing. And the idea is that you, you transmit, you know, multiply the code. So it sort of works for those particular cases.
- 29:15You should specialize it. So the obvious sort of simple stuff is, you know, like binary arithmetic. I have a special version of adding integers, special version floats. Obviously Python, it's much more to special versions for different calling, different things and different attributes and all this sort of stuff.
- 29:30That's sort of the key first stage. I mean, that's mixed in with the second stage, which is really much more to just doing lots and lots of little bits and tweaks memory layout. So that's to do better, better memory layout. You know, modern CPUs are, you know, extremely efficient, but they still have to fetch from, you know, speed light issues with fetching stuff from memory. So, you know, how things are laid out in memory is key performance.
- 29:54And it's sort of just those sort of little bits and tweaks here and just kind of writing the code as we would if it had been written for speed in the first place. So a lot of, you know, CPython is old and it's just sort of evolved. And a lot of it has, there's lots of potential for just sort of rearranging data structures and rearranging the code and so on. And these all add up, you know, a few percent here, a few percent there. And it doesn't take many of those to get a decent speed up.
- 30:20So that's the sort of first two stages. And those are the ones where we have some pretty concrete idea what we're doing.
- 30:25Right. And this is the kind of stuff that will benefit everybody, right? We all use numbers. We all do comparisons. We all do addition call functions and so on.
- 30:33Yeah. I mean, the way we're sort of trending with performance in the moment is that sort of, you know, sort of webby type code, web backend sort of code.
- 30:41You'd be looking at kind of where we are now, I don't know, it's a 25, 30% speed up.
- 30:45Whereas if it's a machine learning, a sort of numerical code, it's more likely to be sort of 10% region.
- 30:51Obviously we'd hope to push both up and by more, I don't think we're particularly focused on either.
- 30:59It's just often the case where, you know, the next sort of obvious sort of convenient speed up lies.
- 31:04And although everyone talks about speed ups and I've been doing the same myself, I mean, it's best to think of really at the time something takes to execute.
- 31:11So it's often just shaving off 1% of the type rather than speed up by 1%.
- 31:16And because, you know, obviously as the overall runtime shrinks, what were marginal improvements become more valuable, you know, shaving off 0.2% might be not worth it now.
- 31:26But once you've sped something up by a factor of three or four, then that suddenly becomes, you know, a percent and it's worth the effort.
- 31:32This portion of Talk Python To Me is sponsored by Linode.
- 31:38Cut your cloud bills in half with Linode's Linux virtual machines.
- 31:41Develop, deploy, and scale your modern applications faster and easier.
- 31:45Whether you're developing a personal project or managing larger workloads, you deserve simple, affordable, and accessible cloud computing solutions.
- 31:53Get started on Linode today with $100 in free credit for listeners of Talk Python.
- 31:58You can find all the details over at talkpython.fm/Linode.
- 32:03Linode has data centers around the world with the same simple and consistent pricing regardless of location.
- 32:09Choose the data center that's nearest to you.
- 32:12You also receive 24, 7, 365 human support with no tiers or handoffs regardless of your plan size.
- 32:20Imagine that, real human support for everyone.
- 32:22You can choose shared or dedicated compute instances, or you can use your $100 in credit on S3 compatible object storage, managed Kubernetes clusters, and more.
- 32:33If it runs on Linux, it runs on Linode.
- 32:35Visit talkpython.fm and click the create free account button to get started.
- 32:40You can also find the link right in your podcast player show notes.
- 32:43Thank you to Linode for supporting Talk Python.
- 32:48Yeah, which leads on to stages three and four.
- 32:50So, you know, just-in-time compilation is always hailed as the sort of the way to speed up interpreted languages.
- 32:55Now, before you move on, let me just like sort of list out what you have on stage two for people who haven't dove into this.
- 33:01Because I think some of the concrete details, you know, people hear this in the abstract.
- 33:05They kind of want to know, like, okay, well, what actually are some of the things you all are considering?
- 33:09So, improved performance for integers less than one machine word.
- 33:13It's been a long time since I've done C++.
- 33:16Is a word two bytes?
- 33:17How big is a word?
- 33:17Well, a word is how big depends on the machine.
- 33:19So, that would be 64 bits for pretty much anything now.
- 33:22Apart from like a little tiny embedded systems, which is 32 still.
- 33:26So, that's a lot of numbers, right?
- 33:28That's many of the numbers you work with are less than 2 billion or whatever that is.
- 33:33Yeah.
- 33:33I mean, basically, there are two types of integers.
- 33:35There's big ones that are used for cryptography and other such things where, you know, it's a number in a sort of mathematical sense, but it's really sort of some elaborate code.
- 33:44And then there's numbers that actually represent the number of things or the number of times you're going to do something.
- 33:49And those are all relatively tiny and they'll all fit.
- 33:52So, the long ones used for cryptography and so on are relatively rare and they're quite expensive.
- 33:56So, it's the other ones we want to optimize for because when you see an integer, that's the integers you get.
- 34:02You know, they aren't in the quadrillion range.
- 34:04They're in the thousands.
- 34:05Right, right.
- 34:06Exactly.
- 34:06A loop index or an array index or something.
- 34:10Some languages, one that I'm thinking of that also maybe is kind of close to where Guido is right now, also in Microsoft space, is C#,
- 34:19which treats integers sometimes as value types and sometimes as reference types.
- 34:24So, that when you're doing like loops and other stuff, they operate more like C++ numbers and less like pi, you know, pointers to pi long objects.
- 34:34Have you considered any of that kind of stuff?
- 34:36Is that what you're thinking?
- 34:37An obvious thing is an old thing as well is to have tagged integers.
- 34:42So, basically, you know, where we would normally have a pointer, we've got a whole bunch of zeros at the end.
- 34:47There's 64 bits.
- 34:48A machine is three.
- 34:50And then for alignment, there's effectively four zeros at the end.
- 34:54So, we're using a sixteenth of the sort of the possible numbers that a pointer could hold, four pointers, which means leaves a bunch for integers and floating point numbers.
- 35:03So, there's a number of what's called tagging schemes.
- 35:06For example, LuaJit, which is a very fast implementation of Lua, uses what's called NAND boxing, which is everything's a floating point, but there is sufficiently something like two to the 53, which is a huge number of not a numbers in the floating point range.
- 35:19So, you could use a lot of those for integers or pointers.
- 35:22Now, that's a little problematic with 64-bit pointers because, obviously, 64 bits is bigger than 53.
- 35:27But there are other schemes where you...
- 35:30So, again, a simple scheme is that, basically, the least significant bit is one for pointers and zero for integers or vice versa.
- 35:38And basically, it just gives you full machine performance for integers because you just basically, anything up to 63 bits fits in a 64-bit integer and has basically all of your numbers.
- 35:49Interesting.
- 35:50Okay.
- 35:50Because it's shifted across all the machine arithmetic works as normal and overflows.
- 35:55You just overflow checks a machine, a single machine instruction and things like this.
- 36:00And that's, again, pretty standard.
- 36:01And they need sort of like fast Lisp implementation and older small talk and other sort of historical languages.
- 36:10JavaScript tends to use things like this NAND boxing I was talking about because all of the numbers are floating point numbers.
- 36:17So, another one that stands out to me here is zero overhead exception handling.
- 36:21Guido, that's making it into 3.11 already, right?
- 36:24That's basically just what we used to have is we'd have a little setup and sort of tear down instruction for every time we wanted to sort of control the block of code inside a try.
- 36:34As a try finally, but also with statements.
- 36:37But we've just ditched those in favor of just a table lookup.
- 36:40So, if there's an exception now, it's just looked up in a table, which is what the JVM Java virtual machine does.
- 36:44Yeah, excellent.
- 36:45ZeroVerhead is a slightly optimistic term.
- 36:48It's obviously not zero overhead, but it is less.
- 36:51You'll have a harder time finding it in the profiler.
- 36:53There's a little bit of memory that you didn't have before.
- 36:56That's a lookup table, but sort of it really is zero overhead if no exceptions happen, right?
- 37:02Not quite.
- 37:03Just because there is extra memories it causes.
- 37:06But also, you know, because of like tracing guarantees, sometimes we have to insert a knob where the try was.
- 37:15So, there's still some slight overhead.
- 37:17And then potentially in future when we compile code, that should effectively become zero.
- 37:21But it is definitely reduced.
- 37:23Mark, Apple surprised the world and they took their phone chips and turned them into desktop chips.
- 37:28And that seemed to actually work pretty well with their ARM stuff.
- 37:32There's a switch not just having basically just x86 and 64-bit stuff to think about, but now you also have this ARM stuff.
- 37:39Does that make life harder or easier?
- 37:41Does it open up possibilities or is it another thing to deal with?
- 37:44It's just harder because it's a bit harder.
- 37:49And we may want to look to the future of RISC-V.
- 37:52So, currently, CPython makes net is portable.
- 37:56That's a key thing.
- 37:58It's portability is, yeah, it rather depends on testing.
- 38:02You know, it's all very well saying it's perfectly portable.
- 38:04But if you have never tested on a platform, you may have surprises.
- 38:08But it's all written in C.
- 38:09And portability is a sort of serious consideration.
- 38:12So, I mean, things like those tagging I was just talking about, that's technically not portable C.
- 38:18But it's certainly, I mean, a lot of things aren't technically portable C, but in effect are.
- 38:23I mean, technically, it's impossible to write a memory allocator in C because the specification says once you've called free, you can't access the memory, which makes it kind of difficult to write something that handles the memory.
- 38:34But, you know, these are oddities.
- 38:36But in practice, you know, if you write sensible C code, you should expect to be portable.
- 38:42So, we are kind of basing around that.
- 38:45I mean, like some other virtual machines, you know, particularly JavaScript ones are effectively written.
- 38:50They're interpreted often written in Assembler or some variant of it.
- 38:53There's definitely a performance advantage in that, but I'm not convinced it's great enough to lose the portability and the maintenance overhead.
- 39:01Yeah.
- 39:01And one of the things that you focused on, Guido, was that you wanted this to be, to keep, one of the constraints is you said you want to keep the code maintainable, right?
- 39:10This is important.
- 39:10Absolutely.
- 39:11Why does that matter so much rather than if we can get 20% speed up if Mark refreshes his assembly language skills?
- 39:17Well, it would leave most of the core development team behind.
- 39:22And so, suddenly, Mark would be a very, very valuable contributor because he's the only one who understands that assembly code.
- 39:31That's just how it goes.
- 39:33Yeah.
- 39:33And I don't think that that would be healthy for the Python ecosystem.
- 39:37If the technology we used was so hard to understand and so hard to learn, making it so hard to maintain, then as an open source project, we'd lose velocity.
- 39:50Right.
- 39:50The only thing that would sort of cause to happen in the core team might be people decide to move more code to Python code because now the interpreter is faster anyway.
- 40:02So they don't have to write so much in C code.
- 40:06But then, of course, likely it's actually going to be slower, at least that particular bit of code.
- 40:12That's an interesting intention to think about.
- 40:13If you could make the interpreter dramatically faster, you could actually do more Python and less C.
- 40:20I don't know.
- 40:20It would have to be.
- 40:21There's some big number where that happens, right?
- 40:23It's not just a 10%, but maybe.
- 40:25That could be in the distant future.
- 40:27But nevertheless, I wouldn't want the C code to be unreadable for most of the core developers.
- 40:34Yeah, I agree.
- 40:35That makes a lot of sense.
- 40:36Being a C expert is not a requirement for being a core developer.
- 40:39In practice, quite a few of the core developers are really good C coders.
- 40:44And we support each other in that.
- 40:47We take pride in it and we help each other out.
- 40:52I mean, code reviews are incredibly important.
- 40:55And we will happily help newbies to sort of get up to speed with C.
- 41:00If we had a considerable portion that was written in assembler.
- 41:04Yeah.
- 41:04And then it would have to be written in sort of multiple assemblers.
- 41:09Or there would also have to be a C version for platforms where we don't have access to the assembler.
- 41:16Nobody has bothered to write that assembler code yet.
- 41:19All these things make things even more complicated than they already are.
- 41:24Right.
- 41:24And the portability and the approachability of it is certainly a huge benefit.
- 41:29Two other constraints that you had here, maybe you could just elaborate on real quick, is don't break stable ABI compatibility and don't break limited API compatibility.
- 41:38Yeah. So the ABI is the application binary interface.
- 41:43And that guarantees that extension modules that use a limited set of C API functions don't have to be recompiled for each new Python version.
- 41:56And so you can, in theory, you can have a wheel containing binary code.
- 42:00And that binary code will still be platform specific, but it won't be Python version specific.
- 42:06Yeah, that's very nice.
- 42:07That sort of that we don't want to break that.
- 42:10It is a terrible constraint because it means we can't move fields like the reference count or the type field around in the object.
- 42:18Many other things as well.
- 42:19But nevertheless, it is an important property because people depend on that.
- 42:24Sure.
- 42:25And the API compatibility, well, that's pretty clear.
- 42:27You don't want people to have to rewrite code.
- 42:28The limited API is sort of the compile time version of the stable ABI.
- 42:33I think it's the same set of functions, except the stable ABI actually means that you don't have to recompile.
- 42:42The limited API offers the same and I think a slightly larger set of API functions where if you do recompile, you're guaranteed to get the same behavior.
- 42:54And again, there are sort of our API is pretty large and a few things have snuck into the limited API and the stable ABI that sort of are actually difficult to support with changes that we want to make.
- 43:10And so sometimes this holds us back.
- 43:13But at the same time, we don't want to break the promises that were made to the Python community about API compatibility.
- 43:20We don't want to say, oh, sorry, folks, we made everything 20% faster.
- 43:25But alas, you're going to have to use a new API and all your extensions.
- 43:30Just recompiling isn't going to be good enough.
- 43:33Some functions suddenly have three arguments instead of two or no longer exists.
- 43:39Or return memory that you own instead of returning a borrowed reference.
- 43:44And we don't want to do any of those things because that just would break the entire ecosystem in a way that would be as bad as the Python 3 transition.
- 43:53Right.
- 43:53And it's, yeah, just not just not worth it.
- 43:55All right.
- 43:56Let's go back to the Shannon plan.
- 43:58So we talked about stage one and stage two.
- 44:01And Mark, I see here this is Python 3.10 and Python 3.11.
- 44:05Are those the numbers where they're actually going to make it in?
- 44:07Or is it, do we have to do like a plus plus or plus equals on them?
- 44:10I think a plus one would be appropriate.
- 44:13All right.
- 44:13Plus equals one.
- 44:14Yeah.
- 44:14So maybe we're a bit faster because obviously I envisioned this was basically me and one other developer.
- 44:21Plus maybe sort of some sort of reasonable buy-in from the wider core development team.
- 44:27So I wasn't sort of doing the work sort of entirely in isolation or, but yeah, I was still having extra hands will definitely help things.
- 44:35Sure.
- 44:35Yeah.
- 44:36So back when you were thinking you were, this was written at 3.9 timeframe, right?
- 44:39And you're like, okay, well the next version, maybe we can do this, the version after that.
- 44:42And by the time it really got going, it's more like 3.11, 3.12 and so on, right?
- 44:46Yeah.
- 44:46It's just around the time.
- 44:47I think we switched from 3.9 to 3.10 development.
- 44:49I think I was sort of thinking.
- 44:51Okay.
- 44:51So stage three out of the four stages you have is, I guess, Python 3.13 now, which is a miniature JIT compiler.
- 45:01Is that a right characterization?
- 45:03I think that's not the compiler.
- 45:05Well, I suppose it would be smaller.
- 45:07Maybe the parts it applies to, the parts that get compiled.
- 45:09Yeah.
- 45:10So I think the idea is that you want to compile all of the code where it sort of forms as bad as it's sort of hot code.
- 45:19But it makes life easier if you just compile little chunks of code and sort of stitch them together afterwards.
- 45:27Because it's very easy to fall back into the interpreter and for the interpreter to jump into sort of compiled code.
- 45:32And you can sort of just hang these bits of compiled code off by individual bytecodes where they sort of start from.
- 45:38Obviously, that's not fantastic for performance because you're having to fall back into the interpreter,
- 45:43which limits your ability to infer things about the state of things.
- 45:48So obviously, if you've said earlier, a specialization, you have to do some type checks and other sort of checks.
- 45:54If you've done a whole bunch of checks, if you then fall back into the interpreter, you have to throw away all that information.
- 45:59If you compile a bigger region of code, which is of the stage four, then you already know something about the code and you can sort of apply those compilations.
- 46:08The problem with trying to do big regions upfront is that if you choose poorly, you can make performance worse.
- 46:16And this is a real issue for, well, the exact existing ones.
- 46:20I think we're going to talk about some of the other historical sort of compilers in the past.
- 46:24And this is a real issue for those that they're just trying to compile a method at a time, regardless of whether that is a sensible unit to compile.
- 46:31Right. It's sometimes hard to do optimizations when it's too small, right?
- 46:35Yeah. And also it's very expensive to do regions that are too big or just in the bounded in the wrong places.
- 46:41Okay. Yeah. That definitely sounds tricky.
- 46:43Guido, there was a question earlier about, you know, mypyc work and the mypy stuff.
- 46:47And you are really central to that, right? Doing a lot of work there.
- 46:51How do you, both of you, either of you, feel about using type annotations as some sort of guide to this compiler?
- 46:59For example, Cython lets you say, you know, x colon int as a parameter, and it will take that as meaning something when you compile it with Cython.
- 47:07It seems like, you know, Mark is talking about knowing the types and guessing them correctly matters in terms of what's fast here.
- 47:14Is there any thought or appetite for using type annotations to mean more than static analysis?
- 47:20It's a great idea. And I think for smaller code bases, something like mypyc will prove to be viable.
- 47:27Or for code bases where there is an incredible motivation to make this happen.
- 47:34I could see that happen at Instagram, for example.
- 47:37But in general, most people haven't annotated their code completely and correctly.
- 47:44And so if you were to switch to using something like mypyc,
- 47:49you'd find that basically it wouldn't work.
- 47:52A large number of cases.
- 47:54And it would basically sort of, it's a different language, and it has different semantics, and it has sort of different rules.
- 48:02And so you have to write to that.
- 48:04I can see there's a big challenge to say, hey, everybody, we can do this great stuff if you type annotated.
- 48:09And only 4% of people have properly annotated their code.
- 48:14And then there's also the possibility that it's incorrectly annotated, in which case it probably makes it worse in some way of a crash or something.
- 48:23mypyc will generally crash if a type is detected that doesn't match the annotation.
- 48:29And if you annotate stuff with simple types, you can get quite good speedup.
- 48:35So number is generally designed for numerical stuff.
- 48:38But again, it's the simple types, integers, floats.
- 48:40Cython, obviously, will do this.
- 48:41Number does it dynamically, cython, statically.
- 48:44And the number model, for example, is similar to the model that Julia language uses.
- 48:49Essentially, you compile method at a time, but you make as many specializations as you need for the particular types.
- 48:56And that can give very good performance for that sort of numerical code.
- 48:59But the problem is that saying something is a particular type doesn't tell you very much about it.
- 49:05It doesn't tell you what attributes an instance of it may or may not have.
- 49:09It depends, you know, because you can, it's not like Java or C++ where having a particular class means it has those instance attributes and they will exist or at least there exist in a particular place and they can be checked very efficiently.
- 49:22Because if dictionary lookup and so on, these things get a bit fuzzy.
- 49:2672 bytes into this C object is where you find the name or something like that, right?
- 49:30Yeah.
- 49:31So because we basically, because anything might not be as the annotations say effectively at the virtual machine level, we have to check everything.
- 49:40And if we're going to check it anyway, we may as well just check it once up ahead as we first do the compilation, whatever specialization, and then assume it's going to be like that.
- 49:50Because if the annotations are correct, then that's just as efficient.
- 49:54And if the annotations are wrong, we still get some performance benefit and it's robust as well.
- 49:59So there's really no, the only advantage of the annotations is for this sort of like very sort of loopy code where we can do things like, you know, loop transformations and so on, because we can infer the types from the arguments of enough of the function to do that stuff.
- 50:16And that works great for numerical stuff.
- 50:17But for more general code is problematic.
- 50:20What about slots?
- 50:21Slots are an interesting, not frequently used aspect of Python types that seem to change how things are laid out a little bit.
- 50:29Yeah.
- 50:29Is that?
- 50:30Well, mypyc actually, one of mypyc's main tricks is that it turns every class into a class with slots.
- 50:39Okay.
- 50:39If you know how slots work, you will immediately see the limitation because it means there are no dynamic attributes at all.
- 50:47Yeah.
- 50:48These are what you get for your fields and that's it.
- 50:50Yeah.
- 50:51I mean, if you don't have dynamic attributes, though, it gives you pretty efficient memory use.
- 50:55I mean, it's a little too far up Java.
- 50:57So it's...
- 50:58And more predictability about what's there and what's not, which is why it came to mind.
- 51:02Yeah.
- 51:02Yeah.
- 51:02I mean, they definitely have their use.
- 51:04Yeah.
- 51:04All right.
- 51:05Mark, that was your four-stage plan, hoping to make 1.5 times as fast as before each time, which you do that over four releases, you end up with five times faster, right?
- 51:17That's the standard plan.
- 51:18Where are we on this?
- 51:19How's it going for you and everyone on the team?
- 51:22I say it's a bit of a jumble of stages one and two that we're implementing, largely because it's a larger, more diverse team than I was expecting.
- 51:30So it makes sense to just sort of spread things.
- 51:33Yeah.
- 51:33Yeah.
- 51:34Yeah.
- 51:34You'll work on operators, you go work on zero overhead exception handling and so on.
- 51:38Yeah.
- 51:38So I would say from where we are now, I was probably a bit optimistic with stage one, but stage two seems to have a lot of potential still.
- 51:49There's always little bits of the interpreter we can tweak and improve.
- 51:52So between the two of them, I'm confident we'll get this projected over twice the speed.
- 51:58That's fantastic.
- 51:59So the course you're on right now, if let's just say stage one and two happen, and for some reason the JET stuff doesn't, that's still a big contribution.
- 52:06What do you think in terms of speed up for that?
- 52:09Well, again, it's going to depend a lot.
- 52:11I know it matters so much, but like, you know.
- 52:13I mean, I just want to, because like currently we have a sort of set of benchmarks that we're using.
- 52:19I mean, not possibly the, I mean, the more benchmarks is always better.
- 52:23So it's a broad set.
- 52:24Individually, the benchmarks, some of them aren't great, but collectively a form a sort of useful data set.
- 52:30But I mean, we speed up from up like up to 60% down to zero.
- 52:33So it's definitely a spread.
- 52:36So it can, you know, try it out would be the thing.
- 52:39I mean, you can download 3.11 Alpha 1 and Alpha 2 should be out a few days at all time now.
- 52:45It's presumably before you publish a podcast.
- 52:48Yeah.
- 52:48Fantastic.
- 52:49So people can download it, play it with it.
- 52:51Yeah, that's fantastic.
- 52:52You know, thank you for this.
- 52:53I think even 50, 60%, if it stayed there, that's pretty incredible.
- 52:58I mean, this language has been around for 30 years.
- 53:01People have been trying to optimize it for a long time.
- 53:03It's incredible, right?
- 53:04And then, you know, to do this sort of change now, that would be really significant.
- 53:08Yeah.
- 53:08This is an area that we haven't spent much time on previously for various reasons.
- 53:15I mean, people have spent a lot of time on sort of making the string of the objects fast,
- 53:21making dictionary operations fast, making the memory efficient, adding functionality that
- 53:27the sort of Python has generally, I think, had more of a focus on functionality than on speed.
- 53:34And so for me, this is also a change in mindset.
- 53:36I'm still learning a lot.
- 53:38Mark actually teaches me a lot about how to think about this stuff.
- 53:41And I decided to buy this horrible book.
- 53:44Well, it's a great book.
- 53:46Computer architecture.
- 53:47But it's also like it weighs more than a 17-inch laptop.
- 53:52Wow.
- 53:53Classic text, but not a light read.
- 53:56Yeah.
- 53:56Down into beyond the software layer, into the hardware bits.
- 54:00It makes me amazed that we have any performance at all and that any performance is predictable
- 54:06because we're doing everything wrong from the perspective of giving the CPU something to work with.
- 54:13I mean, all the algorithms described in there, branch prediction, speculative execution,
- 54:18caching of instructions, all that is aimed at small loops of numerical code.
- 54:25And we have none of that.
- 54:26Yeah.
- 54:27Exactly.
- 54:28C of LC is not a numerical loop.
- 54:30Definitely not.
- 54:31All right.
- 54:31Well, I think that might be it for the time we have.
- 54:34I got a couple of questions from the audience out there.
- 54:36Toon Army Captain says, I'm interested in Guido's thoughts about the Microsoft funded effort
- 54:44versus the developer in residence, particularly in terms of the major work of the language and
- 54:49the CPython runtime going forward.
- 54:50I think these are both good things, both really good things.
- 54:53They seem super different to me.
- 54:55I think it's great that we have a developer in residence.
- 54:57It's a very different role than what we're doing here.
- 55:01The team at Microsoft is at least we're trying to be super focused on performance to the exclusion
- 55:07of almost everything else, except all those constraints I mentioned, of course.
- 55:11The developer in residence is focused on sort of the community, other core developers, but
- 55:20also contributors.
- 55:21Lukasz is great.
- 55:23He's the perfect guy for that role.
- 55:25And his work is completely orthogonal to what we're doing.
- 55:29I hope that somehow the PSF finds funds for keeping the developer in residence role and
- 55:36maybe even expanding it for many years.
- 55:39seems to me like a really important role to smooth the edges of people contributing to
- 55:45CPython.
- 55:46And the difference of what Mark and you all are doing is heads down, focused on writing
- 55:52one type of code, whereas Lukasz is there to make it easier for everyone else to do whatever
- 55:57they were going to do.
- 55:58Right.
- 55:59And I think, you know, one sort of a horizontal scale of the CPython team and the other is very
- 56:05focused, which is also needed.
- 56:06It's actually amazing that we've been able to do all the work that we've been doing over
- 56:13the past 30 years on Python without a developer in residence.
- 56:17I think in the early years, I was probably taking up that role.
- 56:21But the last decade or two, there just have been too many issues, too many peps for me to
- 56:28sort of get everything going and sort of having...
- 56:31I was always working part time on Python and part time working on my day job.
- 56:36Right.
- 56:36Absolutely.
- 56:37Lukasz is working full time on Python.
- 56:39And he has a somewhat specific mandate to sort of help people, help sort of contributions
- 56:48go smoother, make working with the issue tracker easier.
- 56:53So and that sort of developer contributors must be encouraged and rewarded.
- 56:58And currently, often the way the bugs.python.org experience is it's a very old web app and it
- 57:06looks that way.
- 57:07And it's difficult to learn how to do various things with that thing.
- 57:12And so Lukasz is really helping people.
- 57:15Yeah, it's fantastic.
- 57:16With the edges.
- 57:16Of course, there's also the somewhat separate project of switching from bugs.python.org to
- 57:22a purely GitHub-based tracker.
- 57:25Yeah, I was just thinking of that as you were speaking there.
- 57:27Do you think that'll help?
- 57:28I feel like people are more familiar with that workflow.
- 57:31People are more familiar.
- 57:32It's more integrated with the pool request flow that we already have on GitHub.
- 57:37I think it will be great.
- 57:39Expectations is that I think it will be actually happening before the end of this year or very
- 57:44early next year.
- 57:45That'd be fantastic.
- 57:46The code's already there.
- 57:47The work's already there.
- 57:48Might as well have the conversations and the issues and whatnot there.
- 57:52All right, guys.
- 57:52I think we are definitely over time, but I really appreciate, first of all, the work
- 57:57that you're doing, Mark, on this project and Guido on the last 30 years.
- 58:02This is amazing.
- 58:02You can see out in the comments how appreciative folks are for all the work you've done.
- 58:06So thank you for that.
- 58:07Let's close with a final call to action.
- 58:10You have the small team working on it.
- 58:12I'm sure the community can help in some way.
- 58:14What do you want from people?
- 58:15How can they help you either now or in the future?
- 58:18I mean, it's just contribute to CPython.
- 58:19So, I mean, I don't think it's specifically performance.
- 58:23I mean, like all the contributions help improve, you know, co-quality and reliability are still
- 58:30very important.
- 58:31So I don't think particularly people can do.
- 58:35But we do have a sort of ideas repo if people do have sort of things they want to suggest
- 58:41or bounce ideas around, whatever.
- 58:43Maybe they could test their workloads on alpha versions of things like that.
- 58:48Yeah, I mean, that would be fantastic.
- 58:49I mean, we don't really have a set for where people can put that information.
- 58:53But if just open an issue on the ideas thing and post some data, it'd be fantastic.
- 58:57We'd love it for people to try to use the new code and see how it works out for them.
- 59:03Yeah, fantastic.
- 59:04All right.
- 59:04Well, thank you both for being here.
- 59:06It's been great.
- 59:07Our pleasure.
- 59:07Thank you.
- 59:08This has been another episode of Talk Python To Me.
- 59:12Thank you to our sponsors.
- 59:13Be sure to check out what they're offering.
- 59:15It really helps support the show.
- 59:16Choose Shortcut, formerly Clubhouse.io, for tracking all of your project's work.
- 59:21Because you shouldn't have to project manage your project management.
- 59:25Visit talkpython.fm/shortcut.
- 59:28Simplify your infrastructure and cut your cloud bills in half with Linode's Linux virtual machines.
- 59:33Develop, deploy, and scale your modern applications faster and easier.
- 59:36Visit talkpython.fm/linode and click the Create Free Account button to get started.
- 59:42Do you need a great automatic speech-to-text API?
- 59:45Get human-level accuracy in just a few lines of code.
- 59:47Visit talkpython.fm/assemblyai.
- 59:50Want to level up your Python?
- 59:52We have one of the largest catalogs of Python video courses over at Talk Python.
- 59:56Our content ranges from true beginners to deeply advanced topics like memory and async.
- 1:00:01And best of all, there's not a subscription in sight.
- 1:00:04Check it out for yourself at training.talkpython.fm.
- 1:00:06Be sure to subscribe to the show.
- 1:00:08Open your favorite podcast app and search for Python.
- 1:00:11We should be right at the top.
- 1:00:12You can also find the iTunes feed at /itunes, the Google Play feed at /play, and the direct
- 1:00:19RSS feed at /rss on talkpython.fm.
- 1:00:23We're live streaming most of our recordings these days.
- 1:00:25If you want to be part of the show and have your comments featured on the air, be sure to subscribe
- 1:00:30to our YouTube channel at talkpython.fm/youtube.
- 1:00:33This is your host, Michael Kennedy.
- 1:00:35Thanks so much for listening.
- 1:00:36I really appreciate it.
- 1:00:38Now get out there and write some Python code.
- 1:00:39I'll see you next time.
- 1:01:00Thank you.