Latest / Talk Python To Me / #474: Python Performance for Data Science
Transcript
- 0:00Python performance has come a long way in recent times, and it's often the data scientists,
- 0:05with their computational algorithms and large quantities of data, who care the most about
- 0:10this form of performance.
- 0:11It's great to have Stan Siebert back on the show to talk about Python's performance for
- 0:16data scientists.
- 0:17We cover a wide range of tools and techniques that will be valuable for many Python developers
- 0:22and data scientists.
- 0:23This is Talk Python To Me, episode 474, recorded July 18th, 2024.
- 0:30Are you ready for your host?
- 0:31Here he is.
- 0:32You're listening to Michael Kennedy on Talk Python To Me.
- 0:36Live from Portland, Oregon, and this segment was made with Python.
- 0:39Welcome to Talk Python To Me, a weekly podcast on Python.
- 0:45This is your host, Michael Kennedy.
- 0:48Follow me on Mastodon, where I'm @mkennedy, and follow the podcast using @talkpython,
- 0:53both accounts over at fosstodon.org.
- 0:56And keep up with the show and listen to over nine years of episodes at talkpython.fm.
- 1:01If you want to be part of our live episodes, you can find the live streams over on YouTube.
- 1:05Subscribe to our YouTube channel over at talkpython.fm/youtube and get notified about upcoming
- 1:11shows.
- 1:12This episode is sponsored by Posit Connect from the makers of Shiny.
- 1:16Publish, share, and deploy all of your data projects that you're creating using Python.
- 1:20Streamlit, Dash, Shiny, Bokeh, FastAPI, Flask, Quattro, Reports, Dashboards, and APIs.
- 1:27Posit Connect supports all of them.
- 1:29Try Posit Connect for free by going to talkpython.fm/posit, P-O-S-I-T.
- 1:35And it's also brought to you by us over at Talk Python Training.
- 1:39Did you know that we have over 250 hours of Python courses?
- 1:44Yeah, that's right.
- 1:45Check them out at talkpython.fm/courses.
- 1:48Hey, Stan.
- 1:49Hello.
- 1:49Hello, hello.
- 1:50Welcome back to Talk Python To Me.
- 1:51I'm glad to be here.
- 1:52Glad to talk performance.
- 1:53I know.
- 1:54I'm excited to talk performance.
- 1:56It's one of those things I just never get tired of thinking about and focusing on.
- 2:00It's just so multifaceted.
- 2:02And as we will see, even for a language like Python that is not primarily performance focused,
- 2:08there's a lot to talk about.
- 2:09Yeah, there's endless bag of tricks.
- 2:11Yeah.
- 2:12And I would say, you know, sort of undercut my own comment there.
- 2:16Python is increasingly focusing on performance since like 3.10 or so, right?
- 2:21And the secret is that it's because Python integrates so well with other languages.
- 2:26It's sort of always cared about performance in some way.
- 2:29It's just sometimes you had to leave Python to do it.
- 2:31But you've still got to keep the Python interface.
- 2:33There's been such an easy, high-performance escape hatch that making Python itself faster
- 2:39is obviously not unimportant, but maybe not the primary focus, right?
- 2:42Like usability, standard library, et cetera, et cetera.
- 2:45All right.
- 2:45For people who have not heard your previous episode, let's maybe just do a quick introduction.
- 2:51Who's Stan?
- 2:52Yeah.
- 2:52So I am Stan Siebert.
- 2:54I am a manager at Anaconda, well-known purveyor of Python packages and such.
- 2:59My day-to-day job is actually managing most of our open source developers at Anaconda.
- 3:04So that includes the Numba team.
- 3:05And so we'll be talking about Numba today, but other things like we have people working
- 3:09on Jupyter and Beware for Mobile Python and other projects like that.
- 3:13And so that's what I do mostly is focus on how do we have an impact on the open source
- 3:17community and what does Python need to sort of stay relevant and keep evolving?
- 3:22I love it.
- 3:22What a cool job as well, position in that company.
- 3:24Yeah, I'm really grateful.
- 3:25It's a rare position.
- 3:27So I'm really glad I've been able to do it for so long.
- 3:29Yeah.
- 3:29And I would also throw out in the list of things that you've given a shout out to, I would
- 3:34point out PyScript as well.
- 3:36Oh, yes, of course.
- 3:37Yeah.
- 3:37I just started managing the PyScript team again, actually.
- 3:40And so I forgot about that one too.
- 3:41Yes, PyScript.
- 3:42So Python in your web browser, Python everywhere, on your phone, in your browser, all the places.
- 3:47Yeah.
- 3:47I mean, it's a little bit out of left field compared to the other things that you all are
- 3:50working on, but it's also a super important piece, I think.
- 3:54So yeah, really cool.
- 3:56Really cool there.
- 3:57So I think we set the stage a bit, but maybe let's start with Numba.
- 4:04That one's been around for a while.
- 4:05Some people know about it.
- 4:07Others don't.
- 4:08You know, what is Numba and how do we make Python code faster with Numba?
- 4:11Yeah.
- 4:12So there have been a lot of Python compilation projects over the years.
- 4:15Again, Numba's very fortunate that it's now 12 years old.
- 4:18We've been doing it a long time, and I've been involved with it probably almost 10 of those
- 4:22years now.
- 4:22And Python, I think one of Numba's success points is trying to stay focused on an area where
- 4:27we can have a big impact, and that is trying to speed up numerical code.
- 4:30So there's a lot of, again, in data science and other sciences, there's a lot of need to
- 4:36write custom algorithms that do math.
- 4:38And Numba's sweet spot is really helping you to speed those up.
- 4:41So we see Numba used in a lot of places where maybe the algorithm you're looking for isn't
- 4:46already in NumPy or already in JAX or something like that.
- 4:48You need to do something new.
- 4:50Projects like UMAP, which do really novel sort of clustering algorithms.
- 4:54Or I just at SciPy, I learned more about a project called Stumpy, which is for time series analysis.
- 4:59Those authors were able to use Numba to take the numerical core of that project that was
- 5:04the sort of the time bottleneck and speed it up without having to leave Python.
- 5:08And so that is, I think, really where Numba's most effective.
- 5:12Sure.
- 5:13If you look at a lot of programs, there might be 5,000 lines of code or more, but even just
- 5:19something only as big as 5,000 lines.
- 5:22There's a lot of code, but only a little bit of it really actually matters, right?
- 5:26Yeah, that's what we find a lot is when you sit down and measure your code, you'll spot
- 5:30some hotspots where 60 or 70 or 80% of your time is spent in just like three functions or
- 5:36something.
- 5:36And that's great.
- 5:38And if that's the case, that's great because you can just zero in on that section for speeding
- 5:42things up and not ruin the readability of the rest of your program.
- 5:45Sometimes optimization can make it harder to read the result.
- 5:49And so there's always a balance of you have to keep maintaining this project.
- 5:52You don't want to make it unreadable just to get 5% more speed.
- 5:55Yeah, absolutely.
- 5:56Not just the readability, but the ability to evolve it over time, right?
- 6:02So maybe it's like, oh, we're going to compile this section here using Numba or Cython or something
- 6:09like that.
- 6:09Well, maybe I was going to use this cool new IPI package I found, but I can't just jam it
- 6:15in there where it's compiled.
- 6:16That's unlikely to work well, right?
- 6:19And things like that.
- 6:20And so, yeah, a lot of times there's these big sections that look complicated.
- 6:24They look slow.
- 6:25They're not actually.
- 6:26Yeah.
- 6:26And one thing I also often emphasize for people is that when you think about the time your
- 6:31program takes, think about the time you spent working on it as well as the time you spent
- 6:35running it.
- 6:35And so because we've heard from a lot of projects who said they were able to get major speed
- 6:40ups, not because necessarily because Numba compiled their code to be incredibly fast,
- 6:45but it compiled it to be fast enough that they could try new ideas quicker.
- 6:49And so they got to the real win, which was a better way to solve their problem because
- 6:54they weren't kind of mired in just kind of boilerplate coding for so long.
- 6:58Right, right, right.
- 6:59It turns out I learned I should use a dictionary and not a list.
- 7:02And now it's a hundred times faster.
- 7:04And that wasn't actually a compiling thing.
- 7:07That was a visibility thing or something, right?
- 7:09Yeah.
- 7:09Try more things is always helpful.
- 7:11And so something that a tool that lets you do that is really valuable.
- 7:14A hundred percent.
- 7:15So what tools do you recommend for knowing?
- 7:18Because our human intuition sometimes is good, but sometimes is really off the mark in terms
- 7:23of thinking about what parts are slow, what parts are fast.
- 7:25That's something I definitely want.
- 7:26I've talked to people.
- 7:27Everyone thinks they know where the heart, the slow part is, but sometimes they're surprised.
- 7:31And so you definitely before you do anything, it does.
- 7:34This is not just number advice.
- 7:35This is any time before you're going to speed up your program, measure something.
- 7:38So what you want is you want a representative benchmark, something that's not going to run
- 7:43too fast because often, you know, like unit tests run too quickly to really tell you to
- 7:48exercise the program in a realistic way.
- 7:50So you want a benchmark that doesn't run too long, but maybe like five minutes or something.
- 7:53And then you're going to want to run that through a profiling tool.
- 7:57And there are several options.
- 7:58I just usually tell people to use C profile.
- 8:00It's built into the standard library in Python.
- 8:03It's a great tool.
- 8:04It does the job for most stuff.
- 8:05And so sometimes you may, there may be other tools, things like snake vis and other things
- 8:09to help you interpret the result of the profile.
- 8:10But often you'll use C profile to collect the data.
- 8:13And what this does is it samples, it sort of records as the program is running, what are
- 8:19all the functions that are being called and how much time are they taking?
- 8:23And there are different strategies for how to do this, but fundamentally what you get out
- 8:27is a essentially a data set that says, you know, 2% of the time in your, in your, in
- 8:32your program, this function was running and 3% of this function was running.
- 8:35And you can just sort that in descending order and look and see where, what pops out at the
- 8:40top.
- 8:41And sometimes you're surprised.
- 8:42Sometimes you find out it's actually, it wasn't my numerical code.
- 8:45It's that I spent, you know, 80% of my time doing some string operation that I didn't
- 8:49realize it needed to do over and over again.
- 8:51Right, right.
- 8:52Exactly.
- 8:52Some weird plus equals with a string was just creating a thousand strings to get to
- 8:58the end point or something like that.
- 8:59Yeah.
- 8:59Yeah.
- 8:59And it could have just done that once upfront.
- 9:01It's good to do the profiling just to make sure there isn't an obvious problem before you
- 9:06get into the more detailed optimization.
- 9:08Yeah.
- 9:08Before you start changing your code completely, it's execution method or whatever.
- 9:13Yep.
- 9:13Yeah.
- 9:14Yeah.
- 9:14And, you know, shout out to the PyCharm folks.
- 9:16They've got to push the button to profile and they've got to visualize it and they just run
- 9:20C profile right in there.
- 9:21So that's like C profile on easy mode.
- 9:24You know, you get a spreadsheet and you get a graph.
- 9:25What about other ones like Bill, FIL or anything else?
- 9:29Like any other recommendations?
- 9:30Yeah.
- 9:31So that's an interesting point is C profile is for compute time profiling.
- 9:35An interesting problem you run into is this tool does, which is data is memory profiling,
- 9:40which is often a problem when you're scaling up.
- 9:43And that's actually one of the other good things to keep in mind when you're optimizing is what
- 9:46am I trying to do?
- 9:47Am I trying to get done faster?
- 9:48Am I trying to save on compute costs?
- 9:51Am I trying to go bigger?
- 9:52And so I have to speed things up so that I have room to put more data in.
- 9:55If that's where you're going, you might want to be out of memory.
- 9:57Right.
- 9:58Can I just not do?
- 9:59Yeah.
- 9:59Or is that am I already stuck?
- 10:01And so there it is very easy in Python to not recognize when you have temporary arrays and
- 10:07things.
- 10:07Because again, it's also very compact and you're not seeing what's getting allocated.
- 10:11You can accidentally blow up your memory quite a lot.
- 10:13And so this kind of a profiler is a great option for it.
- 10:17What it can often show you is they'll kind of a line by line.
- 10:20This is, you know, how much memory was allocated in each line of your program.
- 10:25So you can see, oh, that one line of pandas.
- 10:27Oops.
- 10:27That that did it.
- 10:29Yeah, I can't remember all the details.
- 10:31I talked to it more about this one, but I feel like it also keeps track of the memory
- 10:36used even down into like NumPy and below, right?
- 10:41Not just Python memory where it says now there's some opaque blob of data science stuff.
- 10:46Yeah.
- 10:46And actually, even on the compute product, there's sort of two approaches.
- 10:49So C profile is focused on counting function time.
- 10:52But sometimes you have a long function.
- 10:54And if you're making a bunch of NumPy calls, you might actually care line by line how much time
- 10:59is being taken.
- 11:00And that can be a better way to think about it.
- 11:01And so I think the tool is called LineProf.
- 11:03Yeah.
- 11:03I forget the exact URL, but it's an excellent tool in Python for there's one in R and there's
- 11:10an equivalent one.
- 11:11Yes.
- 11:12Robert, Robert, LineProfiler.
- 11:14There you go.
- 11:15LineProfiler.
- 11:16Oh, it's archived, but still can be used.
- 11:18Yeah.
- 11:19I have to find another tool now.
- 11:20This is my go-to for so long.
- 11:22I didn't realize it had already been archived.
- 11:24Oh, there's a copy.
- 11:25Hey, but it still works.
- 11:26It's all good.
- 11:26It's all good.
- 11:27It's been transferred to a new location.
- 11:29So that's where it lives now.
- 11:29But yeah, line profiling is another.
- 11:32I often use them complimentary sort of tools.
- 11:34As I zero in on one function that's with C profile, and then I'll go line profile that
- 11:39function.
- 11:39Oh, interesting.
- 11:40Yeah.
- 11:40Okay.
- 11:40Drilling further.
- 11:41Yeah.
- 11:41Okay.
- 11:42Okay.
- 11:42This is the general area.
- 11:43Now let's really focus on it.
- 11:45Memory is another one.
- 11:46I talked to the folks from Bloomberg about that.
- 11:48Oh, okay.
- 11:49I have not used this one.
- 11:50Yeah.
- 11:50This is a pretty new one.
- 11:51And it's quite neat the way it works.
- 11:54Yeah.
- 11:54This one actually tracks C and C++ and other aspects of allocations as well.
- 12:01So one of the problems you can run into with profiling is especially memory profiling, I think.
- 12:06Although if you just want to know about memory, but the more you monitor it, the more it becomes
- 12:10kind of a Heisenberg quantum mechanics type thing.
- 12:14Once you observe it, you change it.
- 12:16And so the answers you get by observing it are not actually what are happening.
- 12:19So you got to keep a little bit of an open mind towards that as well, right?
- 12:23Yeah.
- 12:23And that's even a risk with, you know, other the compute side of the profiling is some you're
- 12:28using some compute time to actually observe the program, which means that it can.
- 12:32And these tools try to subtract out that bias, but it does impact things.
- 12:37And so you may want to have kind of a benchmark that you can run as your kind of real source of
- 12:43truth that you run without the profiler turned on just to see a final runtime run with the
- 12:47profiler to break it down.
- 12:48And then when you're all done, you're going to want to run that program again with the profiler
- 12:51off to see if you've actually improved it while clock time wise.
- 12:55Yeah.
- 12:56Yeah, absolutely.
- 12:56That's a really good point.
- 12:57It's just maybe do a percent time it type of thing or something along those lines.
- 13:01Okay.
- 13:02That was a little bit of a side deep dive into profiling because you, before you apply
- 13:07some of these techniques like Numba and others, you certainly want to know where to
- 13:12apply it.
- 13:13And part of that is you might need to rewrite your code a little bit to make it more optimizable
- 13:19by Numba or these things.
- 13:21So first of all, like what do you do to use Numba, right?
- 13:24It's just, you just put a decorator on there and have you go.
- 13:27At the very simplest level, Numba's interface is supposed to be just one decorator.
- 13:30Now there's some nuance, obviously, and other things you can do, but we tried to get it down
- 13:34to for most people, it's just that.
- 13:37And the N in NGIT means no Python, meaning we get, this code is not calling the Python
- 13:42interpreter anymore at all.
- 13:43It is purely machine code, no interpreter access.
- 13:46Interesting.
- 13:47Okay.
- 13:47So some of these like compile, do a thing and compile your Python code to machine instructions.
- 13:53I feel like they still interact with like Py object pointers and they still kind of work
- 13:59with the API of the Python data types.
- 14:02Yeah.
- 14:03Which is nice, but it's, it's, it's, it's a whole, whole lot slower of an optimization
- 14:08than now it's in 32 and it's, you know, float 32 and these are on registers, you know?
- 14:13Yeah.
- 14:14And this is part of the reason why Numba focuses on numerical code is that NumPy arrays and actually
- 14:19other arrays and PyTorch and other things that support the buffer protocol.
- 14:22The API.
- 14:23So, so really when Numba compiles this, it compiles sort of two functions.
- 14:26One is a wrapper that handles the transition from the interpreter into no Python land, as we call
- 14:32it, and then there's the core function that is kind of like you could have written in C
- 14:35or Fortran or something.
- 14:36And that wrapper is actually doing all the Py object stuff.
- 14:39It's reaching in and saying, ah, this, this integer, I'm going to pull out the actual number
- 14:43and oh, this NumPy array, I'm going to reach in and grab the data pointer and pass those down
- 14:47into the core where the actual, all the math happens.
- 14:50So the only time you interact with the interpreter is really at the edge.
- 14:54And then once you get in there, you try not to touch it ever again.
- 14:57Now, Numba does have a feature that we added some years ago called an object mode block.
- 15:01Which lets you in the middle of your no Python code, go back and actually start talking to
- 15:05the interpreter again.
- 15:06Right.
- 15:07Maybe use a standard library feature or something.
- 15:09Yeah.
- 15:09The most common use we've seen is you like you want a progress bar to update or something
- 15:13that's not in your, you know, hot loop.
- 15:15You don't want, you don't want to be going back to the interpreter in something that's
- 15:18really performance critical.
- 15:19But inside of a function, you might have parts that are more or less, you know, one out
- 15:23of a million iterations.
- 15:23I want to go update the progress bar or something that's totally valid.
- 15:26And you can do that with Numba.
- 15:28There's a way to get back to the interpreter if you really need to.
- 15:31Okay.
- 15:31Yeah.
- 15:31And it says it takes and translates Python functions to optimize machine code at runtime,
- 15:37which is cool.
- 15:38So that makes deploying it super easy.
- 15:39And you don't have to have like compiled wheels for it and stuff.
- 15:42Using industry standard LLVM compilers.
- 15:45And then similar speeds to Cs in Fortran.
- 15:49Yeah.
- 15:50Which is awesome, but also has implications if I can speak.
- 15:55For example, when I came to Python, I was blown away that I could just have integers as big
- 16:02as I want.
- 16:03If I keep adding to them, they just get bigger and bigger.
- 16:05Like billions, bazillions of, you know, bits of accuracy.
- 16:10And I came from C++ and C# and where you explicitly said it's an N32, it's an N64,
- 16:17it's a double.
- 16:18And these all had ranges of valid numbers.
- 16:21And then you've got weird like wraparounds.
- 16:23Maybe you create an unsigned one so you can get a little bit bigger.
- 16:26I suspect that you may fall victim or be subjected to these types of limitations without realizing
- 16:34them in Python if you at NGIT it because you're back in that land, right?
- 16:38Or does it do you guys magic to allow us to have big?
- 16:42We do not handle the big integer, which is what you're describing as sort of that integer
- 16:46that can grow without bound.
- 16:47Because our target audience is very familiar with NumPy.
- 16:50NumPy looks at numbers sort of the way you're described from C++ and other languages.
- 16:55The D type and all that stuff, right?
- 16:57Yeah.
- 16:57NumPy arrays always have a fixed size integer and you get to pick what that is, but it has
- 17:02to be 8, 16, 32, 64.
- 17:04Some machines can handle bigger, but that it is fixed.
- 17:07And so once you've locked that in, you can't over, if you go too big, you'll just wrap around
- 17:12and overflow.
- 17:12Yeah.
- 17:13So that limitation is definitely present again in Numba, but fortunately NumPy users are already
- 17:17familiar with thinking that way.
- 17:19So it isn't an additional constraint on them too much.
- 17:24This portion of Talk Python To Me is brought to you by Posit, the makers of Shiny, formerly
- 17:28RStudio, and especially Shiny for Python.
- 17:31Let me ask you a question.
- 17:33Are you building awesome things?
- 17:35Of course you are.
- 17:36You're a developer or a data scientist.
- 17:37That's what we do.
- 17:38And you should check out Posit Connect.
- 17:41Posit Connect is a way for you to publish, share, and deploy all the data products that you're
- 17:46building using Python.
- 17:47People ask me the same question all the time.
- 17:51Michael, I have some cool data science project or notebook that I built.
- 17:54How do I share it with my users, stakeholders, teammates?
- 17:57Do I need to learn FastAPI or Flask or maybe Vue or React.js?
- 18:02Hold on now.
- 18:03Those are cool technologies, and I'm sure you'd benefit from them, but maybe stay focused
- 18:07on the data project.
- 18:08Let Posit Connect handle that side of things.
- 18:10With Posit Connect, you can rapidly and securely deploy the things you build in Python.
- 18:15Streamlit, Dash, Shiny, Bokeh, FastAPI, Flask, Quarto, ports, dashboards, and APIs.
- 18:21Posit Connect supports all of them.
- 18:24And Posit Connect comes with all the bells and whistles to satisfy IT and other enterprise
- 18:29requirements.
- 18:30Make deployment the easiest step in your workflow with Posit Connect.
- 18:34For a limited time, you can try Posit Connect for free for three months by going to talkpython.fm
- 18:39slash posit.
- 18:40That's talkpython.fm/P-O-S-I-T.
- 18:44The link is in your podcast player show notes.
- 18:46Thank you to the team at Posit for supporting Talk Python.
- 18:50And then one thing you said was that you should focus on using arrays.
- 18:55Yes.
- 18:56And that kind of data structures before you apply Numba JIT compilation to it.
- 19:02Does that mean list as in bracket bracket or these NumPy type vector things?
- 19:07We all have different definitions.
- 19:09Yes, that's true.
- 19:10What are an array?
- 19:11Generally, yeah, usually the go-to I talk to about is a NumPy array.
- 19:15So it has a shape.
- 19:17The nice thing, you know, NumPy arrays can be multidimensional.
- 19:19So you can represent a lot of complex data that way.
- 19:22But within an array, there's a fixed element size.
- 19:25That element could be a record.
- 19:27So if you want for every cell in your array to store maybe a set of numbers or a pair of
- 19:31numbers, you can do that with custom D types and things.
- 19:34And Numba will understand that.
- 19:35That's the ideal data structure.
- 19:37Numba does have, we added support a couple years ago for other data structures because
- 19:42the downside to a NumPy array is that it's fixed size.
- 19:45Once you make it, you can't append to it like you can a Python list.
- 19:49So Numba does have support for both what we call typed lists and typed dictionaries.
- 19:54So these are sort of special cases of lists and dictionaries in Python where the, in the
- 20:00case of a list, every element in the list has the same type.
- 20:02Or in the case of a dictionary, the keys are all the same type and the values are all the
- 20:06same type.
- 20:06Right.
- 20:07And those cover a lot of the cases where, you know, when users want to make things where
- 20:12they don't know how long it's going to be, you're going to append in the algorithm.
- 20:15A list is a much more natural thing than an umpire array where you might like over allocate
- 20:18or something that seems.
- 20:19And dictionaries, our dictionary implementation is basically taken straight from CPython's dictionary
- 20:25implementation.
- 20:26So it's very tuned and very fast in the same way CPython's is.
- 20:29We just had to modify it a little bit to add this type information, but it's really good
- 20:33for kind of look up random items kind of stuff.
- 20:36So those are available as additional data structures in addition to the array.
- 20:40To use those, I would say from number import and something like this.
- 20:45There are new type in the, in the docs, I'll show you, you can sort of import a typed list
- 20:49as a special class that you can create.
- 20:51The downside, by the way, is that, and the reason we have those and we don't just take
- 20:56historically number used to try and let you pass in a Python list is that wrapper function
- 21:01would have to go recursively through the list of list of lists of whatever you might have
- 21:05and pop out all of the elements into some format that wasn't all Py objects so that the no Python
- 21:11code could manipulate them quickly.
- 21:13And then how do you put it all back if you modify that sort of shadow data structure?
- 21:17And so what we realized is that was confusing people and actually added a lot of overhead
- 21:21and calling functions took too long.
- 21:23So we instead went up a level and said, okay, we're going to make a new kind of list that
- 21:27you at the interpreter level can opt into for your algorithm.
- 21:29And so accessing that list from Python is slower than a Python list, but accessing it from
- 21:35Numba is like a hundred times faster.
- 21:37So you kind of have to decide for the, while I'm in this mode, I'm optimizing for numbers
- 21:43performance, not for the Python interpreter performance.
- 21:46Which is reasonable often, I'd imagine, because this is the part you found to be slow.
- 21:50Yeah, that's the trade-off you make.
- 21:52And so, yeah.
- 21:52So we would not suggest people use type lists just in random places in their program.
- 21:57It's really intended to be used.
- 21:58Yeah.
- 21:59I heard this is fast.
- 22:00So we're just going to replace all like new rule.
- 22:03Bracket, bracket is disallowed.
- 22:05We're now using this one, right?
- 22:06Yeah.
- 22:06When you're working with Python objects, Python's data structures can't be beat.
- 22:09They are so well-tuned that it's very, very hard to imagine something that could be faster
- 22:15than them.
- 22:16All right.
- 22:16So maybe one more thing on Numba we could talk about is, so far, I imagine people have
- 22:22been in their mind thinking of, I have at least, running on CPUs, be that on Apple Silicon or
- 22:28Intel chips or AMD or whatever.
- 22:31But there's also support for graphics cards, right?
- 22:34Yes.
- 22:34Yeah.
- 22:35So for a very long, I mean, we've had this again for 10 plus years.
- 22:39We were very early adopters of CUDA, which is the programming interface for NVIDIA GPUs.
- 22:44CUDA is supported by every NVIDIA GPU, whether it's a low-end gamer card or a super high-end
- 22:49data center card.
- 22:50They all support CUDA.
- 22:51So that was really nice for people who were trying to get into GPU programming.
- 22:54You could use inexpensive hardware to learn.
- 22:57And so on both Windows and Linux, Macs don't have NVIDIA GPUs for a long, long time now,
- 23:02but on Windows and Linux, you can basically write what they call a CUDA kernel in pure Python.
- 23:08And it just, you know, and you can pass up, you know, arrays, either NumPy arrays, which
- 23:13then have to be sent to the card or special GPU arrays that are already on the card.
- 23:17That is a great way for people to learn a bit more about GPU programming.
- 23:21I will say Numba might not be the best place to start with GPU programming in Python because
- 23:26there's a great project called Coupy, C-U-P-Y, that is literally a copy of NumPy, but does
- 23:34all of the computation on the GPU.
- 23:35And Coupy works great with Numba.
- 23:37So I often tell people, if you're curious, start with Coupy, use some of those NumPy functions
- 23:42to get a sense of, you know, when is an array big enough to matter on the GPU, that sort of
- 23:47thing.
- 23:47And then when you start wanting to do more custom algorithms, Numba is where you kind of turn
- 23:52to for that second level.
- 23:54Yeah.
- 23:54So I feel like I'm referencing a lot of Etamar's work over here.
- 23:59But what if we didn't have a NVIDIA GPU?
- 24:04Is there anything we could do?
- 24:05Yeah.
- 24:05So there are other projects.
- 24:06So things like, as I mentioned here, like PyTorch and things are, have been ported to a
- 24:11number of different backends.
- 24:12Well, this is one thing the Numba team, we are frequently talking about is how do we add
- 24:16non-GPU or non-NVIDIA GPU support?
- 24:19But it's, I don't have an ETA on that.
- 24:21That's something that we just still are kind of thinking about.
- 24:24But PyTorch, definitely.
- 24:25And you can use PyTorch as an array library.
- 24:28You don't have to be doing machine learning necessarily.
- 24:29You can use it just for fast arrays.
- 24:32It's just most popular for, because it supports, I mean, JAX is a very similar thing, because
- 24:37it adds the extra features you want for those machine learning models.
- 24:39But at the core of every machine learning model, it's just array math.
- 24:42And so you could choose to just do that if that's what you want.
- 24:45And then you could even still pass those arrays off to Numba at some point in the future.
- 24:48I'm interested.
- 24:49Yeah, I didn't realize there was integration.
- 24:50Yeah, I didn't realize there was integration with that as well.
- 24:53Yeah.
- 24:54A while back, we kind of worked with a number of projects to define a GPU array interface
- 24:59that's used by a number of them so that we can see each other's arrays without having
- 25:02to copy the data, which is very helpful.
- 25:03Yeah.
- 25:04Yeah.
- 25:04We have a lot more topics than Numba, but I'm still fascinated with it.
- 25:07Oh, yeah.
- 25:08So, you know, one of the big, all the rages, all the rage now is vector databases, obviously,
- 25:13because I want to query my way through LLM outputs.
- 25:17Right?
- 25:18Like, where in 100,000 dimensional space does this question live?
- 25:22Yep.
- 25:22Or whatever.
- 25:23Is there any integration with that kind of stuff back into Numba?
- 25:27Numba, not directly.
- 25:28Although Numba does have interfaces, an easy way to call out to C functions.
- 25:33So a lot of these vector databases are implemented in, you know, C or C++ or something.
- 25:38And so if you did have a use case where you needed to call out to one of them, if there
- 25:41was a C function call to make directly to sort of the underlying library that bypassed the
- 25:46interpreter, you can do that from Numba.
- 25:47And so I haven't seen anyone do that yet, but it's a generic sort of C interface.
- 25:52Yeah.
- 25:53Maybe there's a database driver written in C, in which case, I don't know all the different
- 25:57databases.
- 25:58I know there are some that are specifically built for it.
- 26:00Maybe DuckDB has got something going on here, but also MongoDB has added vector stuff to
- 26:06it.
- 26:06And I know they have a C library as well.
- 26:07Yeah.
- 26:08I've looked at LanceDB is one I've seen mentioned by used by a couple of projects.
- 26:12That's just for vector stuff.
- 26:14It doesn't do anything else.
- 26:15LanceDB.
- 26:16LanceDB.
- 26:17Okay.
- 26:17I heard about it in the context of another Python LLM project.
- 26:21Cool.
- 26:22Well, that's news to me, but it is a developer-friendly open source database for AI.
- 26:26Okay.
- 26:27Brilliant.
- 26:27All right.
- 26:28Well, like I said, we have more things to talk about.
- 26:31So many things.
- 26:32So many things.
- 26:34But this is super.
- 26:34Okay.
- 26:35One more thing I want to ask you about here before we go on.
- 26:37This has a Cython feel to it.
- 26:40Can you compare and compress Numba to Cython?
- 26:43So Cython uses sort of requires you to put in some type information in order to be able
- 26:48to generate C code that is more efficient.
- 26:50Numba is mainly focused on type inference.
- 26:53So we try to figure out all the types in your function based on the types of the inputs.
- 26:59And so in general, we, although Numba has places where you can put type annotations, we
- 27:03generally discourage people from doing it because we find that it adds work and is error prone
- 27:09and doesn't really help the performance in the end.
- 27:11Numba will figure out all the types directly.
- 27:13And so when it compiles it, if it comes in, if you call it twice with different types,
- 27:17does it just say, well, now we're going to need a, this version of the function underscore
- 27:22strings list rather than integers list or something.
- 27:24Yeah.
- 27:25Yeah.
- 27:25Every Numba compiled function actually contains a dispatcher that will look at the argument
- 27:29types and pick the right one.
- 27:30And it's at pretty high granularity.
- 27:32You know, for example, people who are familiar with multidimensional arrays and like Fortran and
- 27:36C know that they lay out the rows and columns in a different order, which has impact
- 27:41on how you do loops and stuff for, for kind of to maximize locality.
- 27:45Numba can tell the difference between those two cases and will generate different code for
- 27:49those two cases.
- 27:50Wow.
- 27:50So this is stuff that you as the user don't want to even know.
- 27:53No, you don't want to worry about that.
- 27:55That's a whole nother level.
- 27:56So you were like, okay, well, if it's laid out in this order, it's probably this, it appears
- 28:02on the L, you know, the local cache for the CPU in this way.
- 28:06And so if we loop in that direction, we'll like iterate through the cache instead of blow
- 28:09through it every loop or something like that.
- 28:11Basically, we want to make sure that LLVM knows when the step size is one.
- 28:15And that's either on the row or the column access, depending on that.
- 28:18And because, I mean, compilers in general are magic.
- 28:21Like we are grateful that LLVM exists because they can do so many tricks at that level.
- 28:26I mean, because, I mean, this is the same thing that powers clang and other stuff.
- 28:29So, you know, all of, all of macOS compilers are built on LLVM.
- 28:33And so we can leverage all of the tricks they've figured out in decades of development.
- 28:37Yeah, that's cool.
- 28:38And Python itself is compiled with that, at least on macOS.
- 28:42I just saw it last night, you know, that I have clang some version, whatever.
- 28:46When I was just looking at the version for my, my Python, I was compiled with that.
- 28:49Cool.
- 28:50Okay.
- 28:50So we've been on the Numba JIT.
- 28:53Anthony Shaw wrote an article, Python 3.13 gets a JIT.
- 28:57And this is a pretty comprehensive and interesting article on what's going on here.
- 29:03What's your experience with this JIT coming to Python 3.13?
- 29:07This is, and they've definitely tried to set expectations here, that this first release is really planting a flag.
- 29:12It's to say, we're going to start building on top of this base.
- 29:17And so as far as I've seen, the benchmarks for 3.13 are not going to be like the world on fire kind of stuff.
- 29:23So throwing away RC code and rewriting operating systems and JIT in Python.
- 29:27But you have to take a first step.
- 29:29And this is honestly pretty, it impressed me because as a library, we can take a lot of risks and do things that I know we can depend on LLVM.
- 29:37We can do all sorts of stuff that may be not work for everyone, because if Numba doesn't solve your problem, you just don't use it.
- 29:43You can just leave it out of your environment.
- 29:44You don't have to install it.
- 29:46And so it's easy to kind of us to zero in on just the problems that we're good at and say, if this doesn't solve your problem, just leave us out.
- 29:53When you actually are putting a JIT into the core interpreter, everyone gets it.
- 29:57And you have to consider, and Python is so broad that you could grab two Python experts, and they may actually have nothing in common with each other.
- 30:08But are both equal claim to being experts at using Python, but they might use them in different domains and have different libraries they care about and all of that.
- 30:14I feel that way when I talk to Candace people.
- 30:17And I think about me doing like web development APIs and stuff.
- 30:21I'm like, I think I'm really good at Python, generally, you know, good enough to write good apps.
- 30:26But then I look at this, I'm like, I don't even really this.
- 30:29Some of these like expressions that go into the filter brackets.
- 30:33I'm like, I didn't even know that that was possible or really how to apply, you know, like it's just, it's weird to both feel really competent and understand it, but also have it kind of no idea.
- 30:43Yeah, and what I think what you're getting at is those are two really different use cases, and they're getting the same JIT and has to work for both of them.
- 30:50But, you know, combinatorially explode that problem, right?
- 30:53Yeah, and, you know, all the different hardware.
- 30:55I mean, Numbus supports a lot of different computers, but not everyone that Python supports.
- 30:59Like Micro Python?
- 31:00Yeah, or we don't work on, you know, HP UX or anything like that, necessarily.
- 31:05Python has an enormous support, range of supported platforms, an enormous set of use cases.
- 31:09And anything you do is going to affect everyone.
- 31:13So this approach, which I would say this copy and patch JIT approach is really clever, because one of the, you know, again, Numba has to bring, we build a, you know, custom version of LVM.
- 31:21It's a little stripped down, but it's mostly still there.
- 31:23So we have to bring that along for the ride.
- 31:25That's a heavy, heavy dependency to put on the core interpreter for everyone.
- 31:29So the clever bit here is they figured out how to have a JIT, but still do all the compiler stuff at build time.
- 31:35So when you build this copy and patch JIT, you actually need LVM, but only at build time.
- 31:40And then it can go away.
- 31:42And so the person who receives the interpreter doesn't need LVM anymore.
- 31:44And so they basically built for themselves a bunch of little template fragments.
- 31:49This is the patching part is basically you're saying, I've got a bunch of fragments that implement different opcodes in the bytecode different ways.
- 31:56And I'm going to string them together.
- 31:59And then go in and there's a bunch of fill in the blank spots that I can go in and swap in the okay, you get your value from here and then you put it over here and all that.
- 32:07But the actual machine code was generated by LVM by the person who built Python in the first place.
- 32:12I see.
- 32:13It just amazes me this works.
- 32:15And I'm excited to see where they go with it because it was a clever way to avoid adding a huge heavy dependency to Python.
- 32:21Let's start to get some of that JIT benefit.
- 32:24So it looks at some of the common patterns.
- 32:27I see.
- 32:28Okay, we're looping over a list of loads or something and replaces that with more native code or something along those lines.
- 32:35Yeah.
- 32:36Yeah.
- 32:36You essentially have a compiler from a bunch of little recipes that are if I do this pattern, sub in this machine code, fill in these blanks, and you just have a table of them.
- 32:46So it's the challenge there is that there is a combinatorial explosion again of how many different, you know, a full blown compiler like LVM has a bunch of rules.
- 32:55It's rule based.
- 32:56And so it's saying, if I see this pattern, I do this replacement and it keeps doing all of this.
- 33:00And then at the end, it says, okay, now I'm going to generate my machine code from that, those transformations.
- 33:04If I don't have LVM at runtime, I have to kind of figure out what are the best templates up front, put them in this table.
- 33:11And then, you know, and so this is where honestly looking at different usage patterns will probably be a huge help is in practice, you can have any sequence of byte codes, but in reality, you're probably going to have certain ones a lot.
- 33:22And those are the ones you want to focus on.
- 33:24So I think once we, I don't know, you know, once we start getting this out in the community and start getting feedback on it, I'm curious to see how rapidly it can evolve.
- 33:31That'll be really interesting.
- 33:32Yeah.
- 33:32And this whole copy and patch it is we often hear people say, I'm a computer, I have a computer science degree.
- 33:38And I think what that really means is I have a software engineering degree in, or I am a software engineering person.
- 33:44They are not often creating new science, computer science of theories.
- 33:50They're more like, I really understand how operating system works and programmers and compilers.
- 33:54And I write JSON API, sorry, talk to databases.
- 33:58This is like true new research out of legitimate computer science, right?
- 34:02This copy and patch shit.
- 34:04Yeah.
- 34:05They mentioned, I mean, they cite a paper from 2021 and in computer science, going from paper to implementation in one of the most popular languages on earth in three years seems pretty fast.
- 34:14It does seem pretty fast, right?
- 34:16It definitely seems pretty fast.
- 34:17And the reason I bring this up is I imagine that dropping it into one of the most popular programming languages with a super diverse set of architectures and use cases will probably push that science forward.
- 34:29Yeah.
- 34:29This will be tested in one of the most intense environments you could imagine.
- 34:34You know, I mean, whatever they did for their, their research paper or their dissertation or whatever, this is another level of putting it into a test and experimentation to put it into Python.
- 34:44Yep.
- 34:45Yeah.
- 34:45Wild.
- 34:46Okay.
- 34:46Hopefully this speeds things up.
- 34:47This is going to be interesting because it just happens, right?
- 34:50It just happens.
- 34:51If you have Python 3.13, it's going to be looking at its patterns and possibly swapping out.
- 34:55This is complimentary to all of the techniques the faster CPython folks have been doing all along for many releases now.
- 35:02Yeah.
- 35:03Is they've, they've been looking at other ways to speed up the interpreter without going all the way to a full blown compiler, which this is kind of giving you the final step.
- 35:11So that's again, another interesting place is how does this compliment those?
- 35:15You know, I don't know those, those details, but it's another tool in the toolbox to sort of go back to the beginning.
- 35:20It's speed is about having a bunch of tools and you kind of pick up 5% here and 5% there and you pile up enough 5% and pretty soon you have something substantial.
- 35:29Yeah, I absolutely.
- 35:31That was the plan, right?
- 35:31The faster CPython was to make it multiples of times faster by adding 20% improvements release over release over release and, you know, compounding percentages basically.
- 35:41The one thing I don't know about this is we've had the specializing adaptive interpreter that was one of those faster CPython things that came along.
- 35:49You know, is this just the next level of that or is this a replacement for that?
- 35:54I don't know.
- 35:54I'm sure people can.
- 35:55Yeah, I don't know.
- 35:56I don't know what the, what their roadmap is for that because I think part of this is, this is so new.
- 36:00I think they got to see how it works in practice before they start figuring out.
- 36:04I agree.
- 36:05It feels like an alternative to that specialized and adaptive interpreter, but I don't know.
- 36:09Maybe some of the stuff they've learned from one made it possible or even as just an extension of it.
- 36:14Okay.
- 36:14What do we want to talk about next here?
- 36:16I think.
- 36:16You want to talk about threads?
- 36:17No, let's talk.
- 36:19I want to talk about, I want to talk about Rust really quick before we talk about it.
- 36:22Then, because that'll be quick.
- 36:23And then I want to talk about threads because threads will not be as quick and it's super interesting.
- 36:27It's been a problem that people have been chipping at for years and years and years, the threads thing.
- 36:34But what do you think about all this Rust mania?
- 36:38I mean, it's shown some real positive results, things like rough and pydantic and others,
- 36:43but it's actually a little bizarrely controversial or maybe not bizarre, non-obviously controversial.
- 36:48Yeah.
- 36:48I mean, my take on the Rust stuff is I view it in the same light as when we use C and Fortran
- 36:53historically, it's just Rust is a nicer language in many ways.
- 36:55And so being a nicer language means it's certainly, you know, you could have taken any of these things
- 37:01and rewritten them in C a long time ago and they would have been faster.
- 37:04You just didn't want to write that C code.
- 37:07Exactly.
- 37:07You know what?
- 37:08We could do this in assembler and you would fly, guys.
- 37:11Yeah.
- 37:12So Rust is moving things, Rust lowering the bar to saying, okay, maybe I'll implement the core of my algorithm outside of Python entirely.
- 37:21It's interesting.
- 37:22And honestly, I would happily see Rust completely replace C as the dominant extension language in Python.
- 37:28The trade-off here, and this is one of those things that's sometimes easy to forget, again, because the Python community is so diverse,
- 37:34is when you do switch something to Rust, you do reduce the audience who can contribute effectively in some cases.
- 37:41That using Python to implement things has a benefit for the maintainers if it lets them get more contributions, more easily onboard new people.
- 37:51I hear this a lot actually from academic software where you have this constant rotating students and postdocs and things.
- 37:59And so how quickly you can onboard someone who isn't a professional software developer into a project to contribute to it is relevant.
- 38:06And so, but I think it's different for every project.
- 38:09There are some things like, you know, again, Rust in cryptography makes total sense to me because that's also a very security conscious thing.
- 38:16You really don't want to be dealing with C buffer overflows in that kind of code.
- 38:20And so the guarantees Rust offers are valuable also.
- 38:23Well, and I think that that's also makes sense even outside of just security directly.
- 38:29You're going to build a web server.
- 38:30It's a nerve wracking thing to run other people's code on an open port on the Internet.
- 38:35And so this is better.
- 38:38One of the things I switched to is I recently switched to Granian for a lot of my websites, which is a Rust ACP server.
- 38:46It's comparable in performance, slightly faster than other things, but it's way more, it's deviation from its average is way, way better.
- 38:55So it's just more consistent.
- 38:57More consistent, but also, you know, like the average, for example, the average, where's the versus third party server?
- 39:03That's the one I want.
- 39:03So for against uWSGI, for example, right, it's six milliseconds versus 17 milliseconds.
- 39:10Like, whatever.
- 39:11But then you look at the max latency of 60 versus three seconds.
- 39:14It's like, oh, wow.
- 39:16Hold on.
- 39:16Right.
- 39:16But the fact it's written in Rust, I think feels it's a little bit of extra safety, all other things being equal.
- 39:22Right.
- 39:23And that, I mean, obviously a lot of caveats there.
- 39:25Yeah.
- 39:26The actually the interesting point about, and this is not unique to Rust.
- 39:29This is, again, the same problem with C and other things is that it's a little bit interesting.
- 39:32On one hand, we're pushing the Python interpreter and JITs and all this other stuff.
- 39:35At the same time as you're thinking about whether to pull code entirely out of Python.
- 39:39And it creates a barrier where the JIT can't see what's in the Rust code.
- 39:43And so if there was an optimization that could have crossed that boundary, it's no longer available to the compilers.
- 39:49Yeah.
- 39:50This is a problem the number team has been thinking about a lot because our number one request, aside from, you know, other GPUs, is can number be an ahead of time compiler instead of a just in time compiler?
- 40:01And we were like, superficially, yes, that's straightforward.
- 40:04But then we started thinking about the user experience and the developer experience.
- 40:07And there are some things that you lose when you go ahead of time that you have with the JIT.
- 40:12And how do you bridge that gap?
- 40:13Yeah, it gets tricky.
- 40:14We've been trying to figure out some tooling to try and bridge that.
- 40:17So we at SciPy, we did a talk on a project we just started called Pixie, which is a sub project of Numba that is trying to, which doesn't have Rust support yet, but that's been one of the requests.
- 40:27So if you go to github.com/Numba slash Pixie, see if they've indexed it.
- 40:32Oh, they're perfect.
- 40:33Okay.
- 40:33Search engines.
- 40:34Search engines are pure magic.
- 40:36They really are.
- 40:36But yeah.
- 40:37But Pixie, we gave a talk about it at SciPy.
- 40:41It's very early stages.
- 40:42But what we're trying to do is figure out how to, in the ahead of time compilation, whether that's C or Rust or even Numba eventually, capturing enough info that we can feed that back into a future JIT so that the JIT can still see what's going on in the compiled code as kind of a future-proofing.
- 40:57Yeah, that's cool.
- 40:59I know some compilers have profiling-based optimization type things.
- 41:04Like you can compile it with some instrumentation, run it, and then take that output and feed it back into it.
- 41:10And I don't know if I've ever practically done anything with that, but I'm like, oh, that's kind of a neat idea to like try it.
- 41:16Let it see what it does and then feed it back.
- 41:18Is this sort of like that?
- 41:19Or what do you think?
- 41:19This is different.
- 41:21This is sort of, this is basically capturing in the library file.
- 41:24So you compiled ahead of time to a library, capturing the LLVM bitcode so that you could pull it out and embed it into your JIT, which might have other LLVM bitcode.
- 41:32So then you can optimize.
- 41:34You can have a function you wrote in Python that calls a function in C, and you could actually optimize them together.
- 41:39Even though they were compiled at different times, implemented in different languages, you could actually cross that boundary.
- 41:45One's like a ahead of time compilation, just standard compilation.
- 41:48And one is like a JIT thing, but it's like, oh, we're going to click it together in the right ways.
- 41:52Yeah.
- 41:52Wow.
- 41:52Yeah.
- 41:52Because JITs are nice in that they can see everything that's going on, but then they have to compile everything that's going on.
- 41:57And that adds time and latency and things.
- 41:59And so can you have it both ways is that's really what we're trying to do.
- 42:03It's nice when you can't have your cake and eat it too, right?
- 42:05Yes.
- 42:06My cake before my vegetables and it'd be fine.
- 42:09I said that this Rust thing was a little bit controversial.
- 42:12I think there's some just, hey, you're stepping on my square of Python space with a new tool.
- 42:20I don't think that has anything to do with Rust per se.
- 42:22It's just somebody came along and made a tool that is now doing something maybe in better ways or I don't know.
- 42:28I don't want to start up a whole debate about that.
- 42:30But I think the other one is what you touched on is if we go and write a significant chunk of this stuff in this new language, regardless what language it is,
- 42:38Rust is a relatively not popular language compared to others, then people who contribute to that, either from the Python side, we're like, well, there's this big chunk of Rust code now that I don't understand anything about.
- 42:49So I can't contribute to that part of it.
- 42:50And you might even say, well, what about the pro developers or the experienced core developers and stuff?
- 42:57They're experienced and grow at C in Python, which is also not Rust, right?
- 43:01Like it's this new area that is more opaque to most of the community, which I think that's part of the challenge.
- 43:08Yeah.
- 43:09Some people like learning new programming languages and some don't.
- 43:12So on some hand, you know, Rust can be this is a new intellectual challenge and it fixes practically some problems you have with C.
- 43:18In other cases, it's the I wanted to worry about what this project does and not another programming language.
- 43:22Right, right, right.
- 43:23Kind of have to look at your communities and decide what's the right tradeoff for you.
- 43:26Maybe in 10 years, CPython will be our Python and it'll be written in Rust.
- 43:31You know, I mean, if we move to WebAssembly and like PyScript, Pyodid land a lot, like having that right in there's there's there's a non zero probability, but it's not a high number, I suppose.
- 43:42Speaking of something I also thought was going to have a very near zero probability, PEP 703 is accepted.
- 43:49Oh, my goodness.
- 43:49What is this?
- 43:50Yeah.
- 43:50So this was, you know, again, a couple of years ago now, or I guess a year ago, it was finally accepted.
- 43:55So for since very long time, the Python interpreter has, you know, again, threads are an operating system feature that let you do something in a program concurrently.
- 44:04And now that all of our computers have, you know, four, eight, even more cores, depending on, you know, what kind of machine you have, even your cell phone has more than one core.
- 44:14The using those those cores requires you have some kind of parallel computing in your program.
- 44:20And so the problem is that you don't want, you know, once you start doing things in parallel, you have the potential for race conditions.
- 44:26You have the two threads might do the same thing at the same time or touch the same data, get it inconsistent, and then your whole program starts to crash and other bad things happen.
- 44:35So historically, the global interpreter lock has been sort of sledgehammer protection of the CPython interpreter.
- 44:41But the net result was that threads that were running pure Python code basically got no performance benefits.
- 44:48You might get other benefits, like you could have one block on IO while the other one does stuff.
- 44:52And so it was easier to manage that kind of concurrency.
- 44:54But if you were trying to do compute on two cores at the same time in pure Python code, it was just not going to happen because every operation touches a Python object has to lock the interpreter while you make that modification.
- 45:05Yeah, you could write all the multi-threaded code with locks and stuff you want, but it's really just going to run one at a time anyway.
- 45:10Yeah.
- 45:11A little bit like preemptive multi-threading on a single core CPU, right?
- 45:15It's weird.
- 45:16Like I've added all this complexity, but I haven't got much out of it.
- 45:18The secret, of course, is that if your Python program contained not Python, like C or Cython or Fortran, as long as you weren't touching Python objects directly, you could release the GIL.
- 45:27And so Python, so especially in the scientific and computing and data science space, multi-threaded code has been around for a long time.
- 45:34And we've been using it and it's fine.
- 45:36Dask, you can use workers with threads or processes or both.
- 45:39And so I frequently will use Dask with four threads.
- 45:42And that's totally fine because most of the codes in NumPy and Pandas that release the GIL.
- 45:47But that's only a few use cases.
- 45:48And so if you want to expand that to the whole Python interpreter, you have to get rid of the GIL.
- 45:53You have to have a more fine-grained approach to concurrency.
- 45:56And so this proposal from Sam Gross at Meta was basically one of many historical attempts to kind of make that, get rid of that global interpreter lock.
- 46:07Many have been proposed and failed historically.
- 46:09So getting this all the way through the approval process is a real triumph.
- 46:14At the point where it was really being hotly contested, my maybe slightly cynical take is we have between zero and one more chance to get this right in Python.
- 46:23Either it's already too late or this is it.
- 46:27I don't know which it is.
- 46:29I think there were two main complaints against this change.
- 46:33Complaint number one was, okay, you theoretically have opened up a parallel compute thing.
- 46:39So, for example, on my Apple M2 Pro, I have 10 cores.
- 46:44So I could leverage all of those cores, maybe get a five times improvement.
- 46:49But single core regular programming is now 50% slower.
- 46:54And that's what most people do and we don't accept it.
- 46:57All right.
- 46:57That's the one of the size, you know, the golectomy and all that was kind of in that realm, I believe.
- 47:02The other is yet to be determined, I think, is much like the Python 2 to 3 shift.
- 47:08The problem with Python 2 to 3 wasn't that the code of Python changed.
- 47:12It was that all the libraries I like and need don't work here.
- 47:16Right.
- 47:17And so what is going to happen when we take half a million libraries that were written in a world that didn't know or care about threading and are now subjected to it?
- 47:26Yeah.
- 47:26And there's sort of two levels of problem there.
- 47:28There's one that there's work that has to be done to libraries.
- 47:31It's usually with C extensions that, you know, didn't assume that, you know, they assumed a global interpreter lock and they'll have to do some changes to change that.
- 47:38But the other one is a much more kind of cultural thing where the existence of the guild just meant that Python developers just wrote less threaded code.
- 47:46Yeah.
- 47:46They don't think about locks.
- 47:48They don't worry about locks.
- 47:49They just assume it's all going to be fine.
- 47:50Because, again, the race condition doesn't protect threaded code from from the guild.
- 47:54The guild doesn't protect thread code from race conditions, but it just protects the interpreter from race conditions.
- 47:59So you and your application logic are free to make all the thread mistakes you want.
- 48:03But if no one ever ran your code in multiple threads, you would never know.
- 48:06And so we're going to have to face that now.
- 48:08I think that's a super interesting thing that it's a huge cultural issue that people don't think about it.
- 48:13Like I said, I used to do a lot of C++ and C#.
- 48:16And over there, you're always thinking about threading.
- 48:18You're always thinking about, well, what about these three steps?
- 48:21Does it go into a temporarily invalid state?
- 48:23Do I need to lock this?
- 48:24Right.
- 48:24And like C# even had literally a keyword lock, which is like a context manager.
- 48:29You just say lock curly brace and everything in there is like into a lock and out of like, because it's just so part of that culture.
- 48:35And then in Python, you kind of just forget about it and don't worry about it.
- 48:38But that doesn't mean that you aren't taking multiple, like five lines of Python code.
- 48:43Each one can run all on its own, but taken as a block, they may still get into these like weird states where if another thread after three lines observes the data, it's still busted.
- 48:53Right.
- 48:54It's just the culture doesn't talk about it very much.
- 48:57Yeah.
- 48:57If no one ever runs your code in multiple threads, all of those bugs are theoretical.
- 49:01And so it's now what's going to shift is, you know, all of those C extensions will get fixed and everything will be, you know, they'll fix those problems.
- 49:09And then we're going to have a second wave of everyone seeing their libraries used in threaded programs and starting to discover what are the more subtle bugs.
- 49:17Do I have global state that I'm not being careful with?
- 49:20And it's going to be painful, but I think it's necessary for Python to stay relevant into the future.
- 49:26I'm a little worried.
- 49:27I mean, one of the common questions we hear is sort of why is this what multiprocessing is fine.
- 49:31Why don't we do that?
- 49:32And definitely multiprocessing is big challenge is processes don't get to share data directly.
- 49:39So either, you know, if even if I have like read only data, I might if I have to load two gigabytes of data in every process and I want to store start 32 of them because I have a nice big computer.
- 49:48I've just 32 X my data, my memory usage, just so that I can have multiple concurrent computations.
- 49:56Now, there are tricks you can play on things like Linux, where you load the data once and rely on forking to preserve pages of memory.
- 50:03Linux does cool copy on write stuff when you fork, but that's like fragile and not necessarily going to work.
- 50:09And then the second thing, of course, is if any of those have to talk to each other.
- 50:12Now you're talking about pickling objects and putting them through a socket and handing them off.
- 50:16And that is, again, for certain kinds of applications, just a non-starter.
- 50:20Yeah, but then people just start going, well, we're just going to rewrite this in a language that lets us share pointers.
- 50:24Yeah.
- 50:24Or at least memory in process.
- 50:26Yeah.
- 50:26Yeah.
- 50:27There's, again, there are a lot of Python users where this, they don't need this, they don't care about this, this will never impact them.
- 50:32And then there's a whole class of Python users who are desperate for this and really, really want it.
- 50:38Sure.
- 50:39You know, my, I think there's a couple of interesting things here.
- 50:43One, I think that this, I think this is important for stemming people leaving.
- 50:49I thought, I actually don't hear this that much anymore, but I used to hear a lot of we've left for go because we need better parallelism or we've left for this performance reason.
- 50:59And I don't know, that's just a success story of the faster CPython initiative or all the people who had been around and decided they needed to leave.
- 51:07They're gone.
- 51:07And they, we just don't hear them anymore because they left.
- 51:10It's like, you know, I used to hear them say this at the party, but then they said they're going to leave.
- 51:14And I don't hear anyone say they're leaving.
- 51:15Well, it's because everyone's still here.
- 51:16Didn't say that.
- 51:17I don't know.
- 51:18But I do think having this as a capability will be important for people to be able to maybe adopt Python where Python was rejected at the proposal stage.
- 51:30You know, like, should we use Python for this project or something else?
- 51:32Oh, we need threading.
- 51:34We need computational threading.
- 51:35We've got, you know, 128 core.
- 51:37It's out, right?
- 51:38And then no one comes and complains about it because they never even started that process, right?
- 51:42So it'll either allow more people to come into Python or prevent them for leaving for that same argument on some projects.
- 51:48I think that's a pretty positive thing here.
- 51:50Yeah, there's, yeah, we don't get to count all of the projects that didn't come into existence because of the global interpreter lock.
- 51:58It's easy when you're in it to sort of adjust your thinking to not see the limitation anymore because you're so used to routing around it.
- 52:05You don't even stop and think, oh, man, I got to worry about threads.
- 52:08You just don't think threads.
- 52:09I totally agree.
- 52:09And I'll give people two other examples that maybe resonate more if this doesn't resonate with them.
- 52:14It's the, what if I said, oh, it's a little bit challenging to write this type of mobile phone application in Python.
- 52:22Like, well, it's nearly impossible to write a mobile phone application in Python.
- 52:26So we're not even focusing on that as an issue because no one is, I know, Beware and a few other things, there's a little bit of work.
- 52:34So I don't want to just, I don't want to like, I'm not trying to talk bad about them.
- 52:37But as a community, there's not like, it's not a React native sort of thing or a Flutter where there's a huge community of people who are just like, and we could do this.
- 52:45And then how do we, like, there's just not a lot of talk about it.
- 52:48And that doesn't mean that people wouldn't just love to write mobile apps in Python.
- 52:53It's just, it's so far out of reach that it's, it's just a little whisper in the corner for people trying to explore that rather than a big din.
- 53:01And I think, you know, same thing about desktop apps.
- 53:03Wouldn't it be awesome if we could not have Electron, but like some really cool, super nice UI thing that's almost pure Python?
- 53:11It would.
- 53:12But people were not focused on it because no one's trying to do it, but no one's trying to do it because there weren't good options to do it with.
- 53:18Right.
- 53:18And I think the same story is going to happen around performance and stuff with this.
- 53:22Just to jump in, you know, since I have to talk about the Beware folks, I mean, you've described exactly the reason why we fund the Beware development is because, yeah, if we don't work on that now before people sort of, there's a lot of work that has to do before you reach that point where it's easy.
- 53:36And so recently the team was able to get sort of tier three support for iOS and Android into CPython 313.
- 53:43So now we're at the first rung of the ladder of iOS and Android support in CPython.
- 53:48That's awesome.
- 53:49Poga and Briefcase, the two components of Beware are really focused again on that.
- 53:52Yeah.
- 53:53How do I make apps?
- 53:54How do I make for desktop and mobile?
- 53:55And so, but it's, yeah, we ran into people is that they just didn't even realize you could even think about doing that.
- 54:01And so they just, they never stopped to say, oh, I wish I could do this in Python because they just assumed you couldn't.
- 54:06And all the people who really needed to like were required to leave the ecosystem and make another choice.
- 54:12And it will take the same amount of, I was going to say, it takes the same amount of time with this.
- 54:15Even once threads are possible in Python, it'll take years to shift the perception.
- 54:19Yeah.
- 54:19And probably some of the important libraries.
- 54:21Yeah.
- 54:22Yeah.
- 54:22All right.
- 54:23So I'm pretty excited about this.
- 54:25I was hoping something like this would come and I didn't know what form it would be.
- 54:28I said there were the two limitations, the libraries and the culture, which you called out very awesomely.
- 54:33And then also the performance in the, this one is either neutral or a little bit better in terms of performance.
- 54:40So it doesn't have that disqualifying killing of the single thread of performance.
- 54:45The personal taking here, I will say again, because you have to be fairly conservative with CPython because so many people use it.
- 54:51Is that this will be an experimental option that by default, Python won't turn this on.
- 54:56You will have Python 3.13 when you get it, we'll still have the global interpreter lock.
- 55:00But if you build Python 3.13 yourself, or you get another kind of experimental build of it, there's a flag now at the build stage to turn off the GIL.
- 55:08So this is, in this mode, they decided to make, you know, not have to make double negatives.
- 55:13This is Python in free threading mode.
- 55:15And that will be an experimental thing for the community to test, to try out, to benchmark and do all these things for a number of years.
- 55:22They've taken a very measured approach and they're saying, we're not going to force the whole community to switch to this until it's proven itself out.
- 55:29Everyone's had time to port the major libraries, to try it out, to see that it really does meet the promise of not penalizing single threaded stuff too much.
- 55:39Yeah.
- 55:39Or breaking single threaded code too much.
- 55:41Yeah.
- 55:41Yeah.
- 55:42The steering council is reserving the right to decide when this becomes, or if this becomes the official way for Python, you know, I don't know, 3.17 or something.
- 55:52I mean, it could be, it could be several years.
- 55:53And so I just want everyone not to panic.
- 55:56Yeah, exactly.
- 55:57This doesn't get turned on in October.
- 55:59No.
- 55:59And this is super interesting.
- 56:01It's accepted.
- 56:03It only appears in your Python runtime if you build it with this.
- 56:08So I imagine, you know, some people will build it themselves, but someone will also just create a Docker container with Python built with this.
- 56:14And you can get the free threaded Docker version or whatever, right?
- 56:17We've already put out conda packages as well.
- 56:19So if you want to build a conda environment, you actually, if you jump over to the PyFreeThread page.
- 56:24Yeah.
- 56:24Tell people about this.
- 56:25Yeah.
- 56:25We didn't make this.
- 56:26This is the community made this.
- 56:28The scientific Python community put this together.
- 56:30And this is a really great resource, again, focused on, you know, that community, which really wants threading because we have a lot of, you know, heavy numerical computation.
- 56:40And so this is a good resource for things like how do you install it?
- 56:43So there's a link there on what are your options for installing the free threaded CPython.
- 56:46You can get it from Ubuntu or PyEnv or conda.
- 56:49If you go look at the, you know, and you can build it from source.
- 56:53Or get a container.
- 56:53Yeah.
- 56:54So these are, again, this is very focused on the kind of things the scientific Python community cares about.
- 56:58But, but these are things like, you know, have we ported Cython?
- 57:01Have we ported NumPy?
- 57:02Is it being automatically tested?
- 57:03Which release has it?
- 57:05And the nice thing actually is pip as of 24.1, I believe, can tell the difference between wheels for regular Python and free threaded Python.
- 57:13Oh, you can tell by the, there's different wheels as well.
- 57:15Yeah.
- 57:15So there's a, you know, Python has always had this thing called an ABI tag, which is just a letter that you stick after the version number.
- 57:21And T is the one for free threading.
- 57:24And so now you, a project can choose to upload wheels for both versions and make it easier for people to test out stuff.
- 57:31So for example, I mean, Cython, it looks like there are nightly wheels already being built.
- 57:35And so this is, they're moving fast and, you know, definitely.
- 57:39And our conda, we're also very interested in getting into this as well.
- 57:42So that's why we built the conda package for free threading.
- 57:44And we're going to start looking at building more conda packages for these things in order to be able to facilitate testing.
- 57:49Because I think the biggest thing we want to make sure is if you want to know if your code works, you want the quickest way to get an environment to have some place to test.
- 57:56And so making this more accessible to folks is a really high priority.
- 58:00This is cool.
- 58:01There was something like this for Python 2 to 3, I remember.
- 58:04It showed like the top 1,000 packages on PyPI.
- 58:08And how many of them were compatible with Python 3, basically by expressing their language tag or something like that.
- 58:14Yep.
- 58:14Yep.
- 58:15So this is kind of like that.
- 58:15It's also like the can I use.
- 58:17I don't know if you're familiar with that.
- 58:18Can I use from the web dev world?
- 58:22Oh, yeah.
- 58:23Oh, awesome.
- 58:24Yeah, yeah.
- 58:24I've seen this.
- 58:24You're going to say, I want to use this.
- 58:26I want to use this feature.
- 58:27And it'll, or, you know, if I want to say web workers or something like that, and then it'll, you can, it'll show you all the browsers and all the versions.
- 58:34And when were they supported?
- 58:35And this sounds a little bit like that, but for free threaded Python.
- 58:39Which, by the way, free threaded Python is the terminology, right?
- 58:41Not no gil, but free threaded.
- 58:42That is what they've decided.
- 58:43I think they're worried about people trying to talk about no, no gil or, I mean, I don't know.
- 58:47Gilful.
- 58:49Gilful Python.
- 58:51Are you running on a gilful?
- 58:52Yeah.
- 58:53Oh, my gosh.
- 58:54Okay.
- 58:54Interesting.
- 58:55Now, we have a few other things to talk about, but we don't have really much time to talk about them.
- 58:59But there was one thing that we were maybe going to talk about a bit with compiling.
- 59:04You said, you mentioned some talk or something where people were talking about, well, what if we had a static language Python and we compiled it?
- 59:10And related to that, kind of Mr. Magnetic says, could a Python program be compiled into a binary like a JAR or a, you know, Go app or whatever?
- 59:20There are other tools that look at that as a, yeah, a standalone executable.
- 59:24So, yeah, one of the things I just wanted to, you know, shout out a colleague of mine at Anaconda, Antonio Cuny, who is a well-known PyPy developer from long ago.
- 59:31He's worked on PyPy for 20 years.
- 59:32He's been working.
- 59:33And not the package installing thing, but the JIG compiler.
- 59:36PY, PY.
- 59:37PY, PY, PY.
- 59:38Yes.
- 59:38Yeah.
- 59:39Sometimes phonetically, like over audio, it's hard to tell.
- 59:41Yes.
- 59:42Yeah, yeah.
- 59:42So he's been thinking about this stuff for a very long time.
- 59:44His sort of key insight, at least clicked in my head, was that Python is hard to compile because it is so dynamic.
- 59:52I can, in principle, modify the attributes, like even the functions of a class at any point in the execution of the program.
- 59:58I can monkey patch anything.
- 1:00:00I can do this dynamicness is really great for making kind of magical metaprogramming libraries that do amazing things with very little typing.
- 1:00:08But it makes compiling them really hard because you don't get to ever say, okay, this can't ever change.
- 1:00:14And so what he's been trying to do with a project called Spy, which he gave a talk on at PyCon 2024, but I think the recordings aren't up yet for that.
- 1:00:24And so there isn't a, I don't think there's a public page on it, but he does have a talk on it.
- 1:00:28And because I think they've got like the key notes up, the key kind of insight for me for Spy was to recognize that in a typical Python program, all the dynamic metaprogramming happens at the beginning.
- 1:00:38You're doing things like data classes, generating stuff and all kinds of things like that.
- 1:00:43And then there's a phase where that stops.
- 1:00:45And so if we could define a sort of variant of Python where those two phases were really clear, then you would get all of the dynamic expressiveness, almost all the dynamic expressiveness of Python, but still have the ability to then feed that into a compiler tool chain and get a binary.
- 1:01:03This is super early R&D experimental work, but I think that's a really great way to approach it because often there's always been this tension of, well, if I make Python standardize.
- 1:01:12I make Python statically compilable, is it just, you know, C with, you know, different keywords?
- 1:01:17Do I lose the thing I loved about Python, which was how quickly I could express my idea?
- 1:01:22And so this is again to our, you know, having your cake and eating it too.
- 1:01:25This is trying to find a way to split that difference in a way that lets us get most of the benefits of both sides.
- 1:01:31That's pretty interesting.
- 1:01:31And hopefully that talks up soon.
- 1:01:33That'd be really neat.
- 1:01:34Maybe by the time this episode's out, I know the Python videos are starting to roll, like not out on YouTube, but out on, out on the podcast channels.
- 1:01:42It would be fantastic to have, here's my binary of Python.
- 1:01:45Take my data science app and run it.
- 1:01:47Take my desktop app and run it.
- 1:01:49I don't care what you have installed on your computer.
- 1:01:51I don't need you to set up Python 3.10 or higher on your machine and set up a virtual environment.
- 1:01:57Just here's my binary.
- 1:01:59Do it as you will.
- 1:02:00That's another, I throw that in with the mobile apps and the front end or the desktop apps or the front end Python.
- 1:02:08You know, that's another one of those things that it's nobody's pushing towards it.
- 1:02:12Not that many people are pushing towards it because there's not that many use cases for it that people are using it for because it was so challenging that people stopped trying to do that.
- 1:02:21You know?
- 1:02:21Yeah, there's one thing I also, you know, people probably hear me say this too many times, but the most people use apps when they use a computer, not packages or environments.
- 1:02:31And so in the Python space, we are constantly grappling with how hard packages and environments are to work with, talk with, you know, decide again, what languages are in, what, you know, do I care about everything or just Python or whatever?
- 1:02:44That's all very hard.
- 1:02:45But that's actually not how most people interact with the computer at all.
- 1:02:48And so it really is one of those things.
- 1:02:51Again, this is one of the reasons I'm so interested in Beware is Briefcase is like the app packager.
- 1:02:55And the more they can push on that, the more we have a story.
- 1:02:59And again, there are other tools that have been around for a long time, but that's just what I think about a lot.
- 1:03:02We need to focus on tools for making apps because that's how we're going to share our work with 99% of the earth.
- 1:03:09Yeah, 100%.
- 1:03:10I totally agree.
- 1:03:11And lots of props to Keith Russell McGee and the folks over at Beware for doing that and for you guys supporting that work because it's one of those things where there's not a ton of people trying to do it.
- 1:03:23It's not like, well, we're using Django, but is there another way we could do it?
- 1:03:26It's basically the same thing, right?
- 1:03:27It's creating a space for Python where it kind of, I know there's PyInstaller and PyTor app, but it's pretty limited, right?
- 1:03:34Yeah, there's not a lot of effort there.
- 1:03:36And so there are a few people who have been doing it for a long time and others are getting more into it.
- 1:03:41And yeah, so I just, yeah, I wish that we could get more focus on it because there are tools that just don't get a lot of attention.
- 1:03:47Yeah, and they're not very polished and there's so many edge cases and scenarios.
- 1:03:51All right, let's close it out.
- 1:03:52Let's just find a thought on this little topic and then let you wrap this up for us.
- 1:03:56Do you think that's maybe a core developer thing?
- 1:03:59I mean, I know it's awesome that Py2App and PyInstaller and PyFreeze are doing their things, that Toga are doing their things to try to make this happen.
- 1:04:06But I feel like they're kind of looking in at Python and go like, how can we grab what we need out of Python and jam it into an executable and make it work?
- 1:04:13Should we be encouraging the core developers to just go like a Python MyScript --Windows?
- 1:04:21And they're out, you get in .exe or something.
- 1:04:23I don't know, actually, that would be a great question.
- 1:04:24Actually, I would ask Russell that question.
- 1:04:26He would have probably better perspective than I would.
- 1:04:29At some level, it is a tool that is dealing with a lot of problems that aren't core to the Python language.
- 1:04:34And so maybe having it outside is helpful, but maybe there are other things that the core could do to support it.
- 1:04:41I mean, again, a lot of it has to do with the realities of when you drop an application onto a system, you need it to be self-contained.
- 1:04:47You need, sometimes you have to, you know, do you have to trick the import library to know where to find things and all of that?
- 1:04:53That's exactly what I was thinking is, right?
- 1:04:55If Python itself didn't require like operating system level fakes to make it think it is, if it could go like, here is a thing in memory where you just import, this is the import space.
- 1:05:07It's this memory address for these things, and we just run from the EXE rather than dump a bunch of stuff temporarily on disk, import it, throw it, you know, like that kind of weirdness that happens sometimes.
- 1:05:16There is probably definitely improvements that could be made to the import mechanism to support applications.
- 1:05:20Yeah, exactly.
- 1:05:21Well, we've planted that seed.
- 1:05:23Maybe it will grow.
- 1:05:24We'll see.
- 1:05:25All right, Stan, this has been an awesome conversation.
- 1:05:27You know, give us a wrap up on all this stuff, just like sort of find a call to action and summary of what you guys are doing in Anaconda, because there's a bunch of different stuff we talked about that are in this space.
- 1:05:36Yeah, I mean, mainly, I would say I would encourage people that if you want to speed up your Python program, you don't necessarily have to leave Python.
- 1:05:42Go take a look at some of these tools.
- 1:05:44Go, you know, measure what your program's doing.
- 1:05:47Look at tools like Numba, but there are other ones out there, you know, PyTorch and Jaxx and all sorts of things.
- 1:05:51There are lots of choices now for speed, and so Python doesn't have to be slow.
- 1:05:54You just have to sort of figure out what you're trying to achieve and find the best tool for that.
- 1:05:59Oh, one other thing I do want to shout out.
- 1:06:01I'm teaching a tutorial in a month over at the Anaconda sort of live tutorial system, which will be how to use Numba.
- 1:06:09So if something you saw here you want to go deep on, there will be a tutorial I hopefully linked in the show notes or something.
- 1:06:15Yeah, I can link that in the show notes.
- 1:06:17No problem.
- 1:06:17Absolutely.
- 1:06:18So I'll be going in.
- 1:06:20Is that the high performance Python with Numba?
- 1:06:22Yes.
- 1:06:23Yes.
- 1:06:24So, yeah, we'll be doing worked examples and you'll get to ask questions and all that stuff.
- 1:06:28Cool.
- 1:06:28I'll make sure to put that in the show notes so people can check it out.
- 1:06:30Mm-hmm.
- 1:06:31Cool.
- 1:06:31All right.
- 1:06:31Well, thanks for sharing all the projects that you guys are working on and just the broader performance stuff that you're tracking.
- 1:06:37Yeah, awesome.
- 1:06:38Glad to chat.
- 1:06:39You bet.
- 1:06:39See you later.
- 1:06:40This has been another episode of Talk Python To Me.
- 1:06:43Thank you to our sponsors.
- 1:06:45Be sure to check out what they're offering.
- 1:06:47It really helps support the show.
- 1:06:49This episode is sponsored by Posit Connect from the makers of Shiny.
- 1:06:53Publish, share, and deploy all of your data projects that you're creating using Python.
- 1:06:57Streamlit, Dash, Shiny, Bokeh, FastAPI, Flask, Quarto, Reports, Dashboards, and APIs.
- 1:07:04Posit Connect supports all of them.
- 1:07:06Try Posit Connect for free by going to talkpython.fm/posit, P-O-S-I-T.
- 1:07:12Want to level up your Python?
- 1:07:14We have one of the largest catalogs of Python video courses over at Talk Python.
- 1:07:18Our content ranges from true beginners to deeply advanced topics like memory and async.
- 1:07:23And best of all, there's not a subscription in sight.
- 1:07:25Check it out for yourself at training.talkpython.fm.
- 1:07:28Be sure to subscribe to the show.
- 1:07:30Open your favorite podcast app and search for Python.
- 1:07:33We should be right at the top.
- 1:07:35You can also find the iTunes feed at /itunes, the Google Play feed at /play, and the
- 1:07:40direct RSS feed at /rss on talkpython.fm.
- 1:07:44We're live streaming most of our recordings these days.
- 1:07:47If you want to be part of the show and have your comments featured on the air, be sure to
- 1:07:51subscribe to our YouTube channel at talkpython.fm/youtube.
- 1:07:55This is your host, Michael Kennedy.
- 1:07:57Thanks so much for listening.
- 1:07:58I really appreciate it.
- 1:08:00Now get out there and write some Python code.
- 1:08:01Now get out there and write some Python code.
- 1:08:01And I'll see you next time.