WEBVTT

00:00:00.300 --> 00:00:02.020
<v Michael Kennedy>NumPy already releases the gill,

00:00:02.290 --> 00:00:05.420
<v Michael Kennedy>so threads should already pay off for your NumPy code, right?

00:00:05.860 --> 00:00:12.280
<v Michael Kennedy>Christopher Orisa tested that. He summed the rows of 10,000 by 10,000 arrays on Python 3.14.

00:00:13.140 --> 00:00:13.680
<v Michael Kennedy>Sequentially,

00:00:13.910 --> 00:00:15.380
<v Michael Kennedy>it took 360 milliseconds.

00:00:15.760 --> 00:00:19.120
<v Michael Kennedy>A thread pool took 373 milliseconds,

00:00:19.640 --> 00:00:25.340
<v Michael Kennedy>slower than doing it in single-threaded mode. The same code on free-threaded Python took 83

00:00:25.900 --> 00:00:26.260
<v Michael Kennedy>milliseconds.

00:00:26.920 --> 00:00:30.500
<v Michael Kennedy>Free-threaded Python is now officially supported in Python 3.14,

00:00:30.670 --> 00:00:31.540
<v Michael Kennedy>and that's a huge

00:00:31.810 --> 00:00:32.700
<v Michael Kennedy>opportunity for us.

00:00:33.320 --> 00:00:37.820
<v Michael Kennedy>But this came as a surprise to me, and it may to you as well. The gil isn't

00:00:38.080 --> 00:00:38.760
<v Michael Kennedy>actually gone.

00:00:38.920 --> 00:00:40.060
<v Michael Kennedy>It's a zombie.

00:00:40.380 --> 00:00:44.920
<v Michael Kennedy>If you import one compiled package that hasn't opted in, for example,

00:00:45.420 --> 00:00:46.260
<v Michael Kennedy>at the time of recording,

00:00:46.560 --> 00:00:51.040
<v Michael Kennedy>Psycho PG2, the gil comes back on for your entire free-threaded process.

00:00:51.400 --> 00:00:52.080
<v Michael Kennedy>You get a warning,

00:00:52.460 --> 00:00:52.860
<v Michael Kennedy>not an error.

00:00:53.440 --> 00:00:56.040
<v Michael Kennedy>Christopher is the creator of StackFrame and its C extension library,

00:00:56.240 --> 00:00:56.800
<v Michael Kennedy>ArrayKit.

00:00:56.950 --> 00:01:01.400
<v Michael Kennedy>And we dig into when threads beat plain NumPy, how to tell if you're actually running free

00:01:01.560 --> 00:01:03.280
<v Michael Kennedy>threaded and conditional futures,

00:01:03.960 --> 00:01:06.880
<v Michael Kennedy>his drop-in thread pool that stops your code from getting

00:01:07.240 --> 00:01:11.680
<v Michael Kennedy>slower when you run into a single threaded or gil-based situation.

00:01:12.500 --> 00:01:15.060
<v Michael Kennedy>This is Talk Python To Me, episode 570,

00:01:15.340 --> 00:01:16.860
<v Michael Kennedy>recorded October 13th,

00:01:17.140 --> 00:01:17.900
<v Michael Kennedy>2026.

00:01:35.840 --> 00:01:40.160
<v Michael Kennedy>Welcome to Talk Python To Me, the number one Python podcast for developers and data scientists.

00:01:40.680 --> 00:01:42.060
<v Michael Kennedy>This is your host, Michael Kennedy.

00:01:42.280 --> 00:01:46.000
<v Michael Kennedy>I'm a PSF fellow who's been coding for over 25 years.

00:01:46.720 --> 00:01:47.700
<v Michael Kennedy>Let's connect on social media.

00:01:47.820 --> 00:01:50.340
<v Michael Kennedy>You'll find me and Talk Python on Mastodon, Bluesky,

00:01:50.720 --> 00:01:51.160
<v Michael Kennedy>and X.

00:01:51.520 --> 00:01:53.340
<v Michael Kennedy>The social links are all in your show notes.

00:01:54.120 --> 00:01:57.620
<v Michael Kennedy>You can find over 10 years of past episodes at talkpython.fm.

00:01:57.800 --> 00:02:01.000
<v Michael Kennedy>And if you want to be part of the show, you can join our recording live streams.

00:02:01.280 --> 00:02:01.820
<v Michael Kennedy>That's right.

00:02:02.120 --> 00:02:05.280
<v Michael Kennedy>We live stream the raw uncut version of each episode on YouTube.

00:02:05.880 --> 00:02:10.300
<v Michael Kennedy>Just visit talkpython.fm/youtube to see the schedule of upcoming events.

00:02:10.490 --> 00:02:14.180
<v Michael Kennedy>Be sure to subscribe there and press the bell so you'll get notified anytime we're recording.

00:02:14.860 --> 00:02:17.160
<v Michael Kennedy>It's Black Friday week here at Talk Python.

00:02:17.400 --> 00:02:21.000
<v Michael Kennedy>The entire library is $50 off with the Everything Bundle.

00:02:21.460 --> 00:02:23.900
<v Michael Kennedy>And there's a new starter set of courses,

00:02:24.400 --> 00:02:24.860
<v Michael Kennedy>four courses,

00:02:25.480 --> 00:02:28.060
<v Michael Kennedy>for learning Python in the age of AI.

00:02:28.480 --> 00:02:30.000
<v Michael Kennedy>And that's only $56.

00:02:30.740 --> 00:02:36.580
<v Michael Kennedy>The Talk Python in production book is 25% off and membership at Talk Python is 30% off,

00:02:36.840 --> 00:02:39.200
<v Michael Kennedy>which gets you into our discords and monthly meetups.

00:02:39.800 --> 00:02:42.280
<v Michael Kennedy>Visit talkpython.fm/Black Friday.

00:02:42.960 --> 00:02:44.540
<v Michael Kennedy>The sales end December 2nd.

00:02:44.980 --> 00:02:46.140
<v Michael Kennedy>Thanks for supporting the show.

00:02:47.120 --> 00:02:51.400
<v Michael Kennedy>I'm really excited about this upcoming conversation with Chris about free threading in Python.

00:02:51.980 --> 00:02:53.880
<v Michael Kennedy>It's something that he and I both care a lot about.

00:02:54.310 --> 00:02:58.120
<v Michael Kennedy>And while it's been fine that Python doesn't really have true threading,

00:02:58.480 --> 00:02:59.440
<v Michael Kennedy>now that we do,

00:02:59.660 --> 00:03:04.040
<v Michael Kennedy>it's important that we actually have libraries and tools that actually use it.

00:03:04.720 --> 00:03:07.720
<v Michael Kennedy>Chris has a bunch of really awesome advice and some great open source libraries

00:03:08.040 --> 00:03:13.740
<v Michael Kennedy>he's created to help manage free threaded and GIL-based apps that both have to run on the same code base.

00:03:14.140 --> 00:03:17.800
<v Michael Kennedy>I'm somewhat inspired by his conversation and previous work I was already doing.

00:03:17.940 --> 00:03:21.780
<v Michael Kennedy>I actually created three new open source projects related to free-threaded Python

00:03:22.260 --> 00:03:24.580
<v Michael Kennedy>that I just want to give a quick heads up to you all about.

00:03:24.980 --> 00:03:27.160
<v Michael Kennedy>I would have certainly brought them up during the conversation with Chris,

00:03:27.560 --> 00:03:28.900
<v Michael Kennedy>but they didn't exist at that time.

00:03:29.220 --> 00:03:31.240
<v Michael Kennedy>The magic of time-shifting and podcasting.

00:03:32.160 --> 00:03:34.040
<v Michael Kennedy>The first one is called GilGuard.

00:03:34.400 --> 00:03:37.120
<v Michael Kennedy>It's a pure Python library that, if included in your app,

00:03:37.360 --> 00:03:40.320
<v Michael Kennedy>will alert you and even raise an exception if you want

00:03:40.600 --> 00:03:43.600
<v Michael Kennedy>if one of your imports turns the Gil back on in free-threaded Python.

00:03:44.400 --> 00:03:45.820
<v Michael Kennedy>The second one is Chameleon RS,

00:03:46.140 --> 00:03:47.640
<v Michael Kennedy>a thread-safe, free-threaded,

00:03:47.900 --> 00:03:48.000
<v Michael Kennedy>optimized,

00:03:48.470 --> 00:03:50.260
<v Michael Kennedy>Rust-based Chameleon template engine.

00:03:50.900 --> 00:03:52.240
<v Michael Kennedy>And the last one is new,

00:03:52.620 --> 00:03:53.960
<v Michael Kennedy>DiskCacheOxide.

00:03:54.600 --> 00:03:57.680
<v Michael Kennedy>This is the DiskCache library we've discussed previously on the show,

00:03:58.240 --> 00:04:00.880
<v Michael Kennedy>rewritten to be, you know it, free-threaded, safe,

00:04:01.150 --> 00:04:01.600
<v Michael Kennedy>in Rust,

00:04:01.760 --> 00:04:02.620
<v Michael Kennedy>highly optimized,

00:04:02.770 --> 00:04:04.980
<v Michael Kennedy>so it can take full advantage of free-threaded Python.

00:04:05.640 --> 00:04:08.220
<v Michael Kennedy>All three of these projects have links in the podcast show notes,

00:04:08.840 --> 00:04:09.720
<v Michael Kennedy>so check them out.

00:04:10.000 --> 00:04:11.880
<v Michael Kennedy>Thanks to Chris for inspiring Gilgard.

00:04:12.240 --> 00:04:13.640
<v Michael Kennedy>Let's jump into the conversation.

00:04:14.780 --> 00:04:14.880
<v Michael Kennedy>Chris,

00:04:15.060 --> 00:04:16.260
<v Michael Kennedy>welcome back to Talk Python To Me.

00:04:16.660 --> 00:04:17.280
<v Michael Kennedy>Amazing to have you here.

00:04:17.459 --> 00:04:17.840
<v Christopher Ariza>Thanks, Michael.

00:04:18.100 --> 00:04:19.060
<v Christopher Ariza>It's really good to be back.

00:04:19.440 --> 00:04:20.940
<v Michael Kennedy>Well, more dynamicism,

00:04:21.180 --> 00:04:23.820
<v Michael Kennedy>less static frames this time.

00:04:24.180 --> 00:04:25.580
<v Michael Kennedy>Had you on for static frame last time?

00:04:25.820 --> 00:04:26.000
<v Christopher Ariza>Yeah,

00:04:26.200 --> 00:04:26.260
<v Christopher Ariza>yeah.

00:04:26.440 --> 00:04:27.080
<v Christopher Ariza>It's been a while.

00:04:28.040 --> 00:04:33.460
<v Christopher Ariza>The static frame has grown even more static with a lot of work in static typing.

00:04:34.480 --> 00:04:37.080
<v Christopher Ariza>And TypeVar Tuple last year I was doing a lot of work with.

00:04:37.260 --> 00:04:38.460
<v Christopher Ariza>So it's even more static.

00:04:38.740 --> 00:04:40.460
<v Christopher Ariza>But today we can talk about more dynamics.

00:04:40.720 --> 00:04:41.900
<v Michael Kennedy>Well, we can.

00:04:42.280 --> 00:04:43.840
<v Michael Kennedy>though I and I know we will.

00:04:44.100 --> 00:04:46.260
<v Michael Kennedy>However, I do think static things,

00:04:46.880 --> 00:04:48.060
<v Michael Kennedy>immutable things actually

00:04:48.680 --> 00:04:50.560
<v Michael Kennedy>have a really important place in this topic.

00:04:50.820 --> 00:04:51.460
<v Christopher Ariza>Yeah, that's right.

00:04:52.140 --> 00:04:52.400
<v Christopher Ariza>You know,

00:04:52.620 --> 00:04:53.680
<v Christopher Ariza>as we move more

00:04:53.820 --> 00:04:56.080
<v Christopher Ariza>into a multi-threaded universe in Python,

00:04:57.000 --> 00:04:59.780
<v Christopher Ariza>having immutable containers is even more important. And

00:04:59.940 --> 00:05:00.120
<v Christopher Ariza>so,

00:05:00.660 --> 00:05:05.660
<v Christopher Ariza>you know, I've been waiting for Python's immutable frozen dictionary for so many years.

00:05:05.900 --> 00:05:08.440
<v Christopher Ariza>And finally, we get that with Python 3.15.

00:05:10.400 --> 00:05:14.960
<v Christopher Ariza>And I think that attention to immutable data structures is really going to become important in Python.

00:05:15.340 --> 00:05:15.520
<v Michael Kennedy>Yeah,

00:05:15.680 --> 00:05:17.360
<v Michael Kennedy>the frozen dict, which is really interesting.

00:05:17.900 --> 00:05:18.440
<v Michael Kennedy>We get,

00:05:18.790 --> 00:05:21.160
<v Michael Kennedy>you know, all this stuff came out October 9th,

00:05:21.320 --> 00:05:23.100
<v Michael Kennedy>which is a little later than originally planned.

00:05:23.260 --> 00:05:27.020
<v Michael Kennedy>But it came out October 9th, which is four days before the recording.

00:05:27.240 --> 00:05:29.280
<v Michael Kennedy>So for us, even depending on when people listen,

00:05:29.440 --> 00:05:31.780
<v Michael Kennedy>but for us, this is a brand new Python 3.15.

00:05:31.980 --> 00:05:32.320
<v Michael Kennedy>It's amazing.

00:05:32.660 --> 00:05:33.160
<v Christopher Ariza>Yeah, that's right.

00:05:33.320 --> 00:05:34.440
<v Michael Kennedy>Tell people quickly about yourself.

00:05:34.800 --> 00:05:37.160
<v Michael Kennedy>It's been a little while since we've talked on the show.

00:05:37.640 --> 00:05:38.020
<v Michael Kennedy>And so.

00:05:38.520 --> 00:05:38.620
<v Christopher Ariza>Sure.

00:05:39.680 --> 00:05:40.480
<v Christopher Ariza>So I,

00:05:40.820 --> 00:05:42.200
<v Christopher Ariza>for 14 years,

00:05:42.440 --> 00:05:46.960
<v Christopher Ariza>I've been at Research Affiliates, which is a small finance firm located in Newport Beach.

00:05:47.500 --> 00:05:55.620
<v Christopher Ariza>I started there as a software engineer and moved my way up to lead some teams and ultimately became the chief technology officer.

00:05:56.560 --> 00:05:58.080
<v Christopher Ariza>And I held that role for a couple of years.

00:05:58.400 --> 00:05:59.220
<v Christopher Ariza>This year,

00:06:00.070 --> 00:06:06.620
<v Christopher Ariza>the company sold off its index business and has restructured into a new entity.

00:06:07.700 --> 00:06:12.040
<v Christopher Ariza>That was a big project for me for about a year and a half working on that transaction.

00:06:12.980 --> 00:06:13.880
<v Christopher Ariza>But that is done.

00:06:14.260 --> 00:06:19.320
<v Christopher Ariza>And as such, I'll be leaving the firm at the end of the year and we'll be moving on to other endeavors.

00:06:19.880 --> 00:06:20.760
<v Michael Kennedy>Well, congratulations,

00:06:21.320 --> 00:06:21.660
<v Michael Kennedy>I guess.

00:06:21.880 --> 00:06:23.180
<v Michael Kennedy>And, you know, that's a very long run.

00:06:23.400 --> 00:06:27.140
<v Michael Kennedy>And it's cool to kind of lead a big group of people working on big projects,

00:06:27.300 --> 00:06:27.400
<v Michael Kennedy>right?

00:06:27.740 --> 00:06:29.500
<v Michael Kennedy>the CTO side of things and all that.

00:06:30.040 --> 00:06:30.180
<v Christopher Ariza>Yeah,

00:06:30.340 --> 00:06:30.460
<v Christopher Ariza>exactly.

00:06:30.760 --> 00:06:30.900
<v Christopher Ariza>I mean,

00:06:31.080 --> 00:06:35.020
<v Christopher Ariza>that's what I already miss working with all my AI agents

00:06:35.140 --> 00:06:38.340
<v Christopher Ariza>is the camaraderie of working with people and building teams

00:06:38.600 --> 00:06:39.420
<v Christopher Ariza>and building engagement.

00:06:40.300 --> 00:06:41.980
<v Christopher Ariza>I can have all my agents do a ton of work,

00:06:42.180 --> 00:06:44.020
<v Christopher Ariza>but I miss the banter.

00:06:44.140 --> 00:06:48.780
<v Christopher Ariza>I miss the shared ideas and the creativity that comes from working

00:06:48.940 --> 00:06:50.080
<v Christopher Ariza>with people on all those things.

00:06:50.320 --> 00:06:52.100
<v Christopher Ariza>But we can get a lot done.

00:06:52.900 --> 00:06:53.300
<v Michael Kennedy>Yeah,

00:06:53.900 --> 00:06:55.020
<v Michael Kennedy>it's just nothing but business,

00:06:55.240 --> 00:06:55.360
<v Michael Kennedy>folks.

00:06:55.520 --> 00:06:55.860
<v Michael Kennedy>Let's go.

00:06:56.000 --> 00:06:56.300
<v Michael Kennedy>Let's go.

00:06:58.120 --> 00:07:03.400
<v Michael Kennedy>so for me obviously i've been working on my own for for quite a while i worked it before of course

00:07:03.620 --> 00:07:09.920
<v Michael Kennedy>but since 2016 it's just been me and my own business and so i totally get what you're saying

00:07:10.120 --> 00:07:14.440
<v Michael Kennedy>about this like being around people and so on luckily i get to talk to folks like you on the

00:07:14.600 --> 00:07:20.200
<v Michael Kennedy>show every week which is great but when when the ai stuff came around i actually it was actually a

00:07:20.230 --> 00:07:26.340
<v Michael Kennedy>little unnerving to me how impersonal and third person it would be like the user has reported the

00:07:26.360 --> 00:07:27.120
<v Michael Kennedy>is unacceptable.

00:07:27.370 --> 00:07:28.460
<v Michael Kennedy>We are now refactoring.

00:07:28.960 --> 00:07:29.700
<v Michael Kennedy>Please stop.

00:07:30.000 --> 00:07:32.000
<v Michael Kennedy>You're the only thing I talk to all day.

00:07:32.460 --> 00:07:36.060
<v Michael Kennedy>Don't call me the user in third person. Like Michael, my name is Michael.

00:07:36.300 --> 00:07:36.900
<v Michael Kennedy>Address me. Right.

00:07:37.460 --> 00:07:39.260
<v Michael Kennedy>And I got it too. And now it's like, Hey,

00:07:39.420 --> 00:07:39.680
<v Michael Kennedy>Michael,

00:07:39.920 --> 00:07:40.560
<v Michael Kennedy>we're working on this.

00:07:40.760 --> 00:07:41.620
<v Michael Kennedy>And then like Michael said,

00:07:41.680 --> 00:07:42.980
<v Michael Kennedy>if we want to do that, I'm like, okay,

00:07:43.280 --> 00:07:44.380
<v Michael Kennedy>it's a little bit better.

00:07:44.720 --> 00:07:45.240
<v Michael Kennedy>It's a little bit better.

00:07:46.060 --> 00:07:46.460
<v Christopher Ariza>That's hilarious.

00:07:46.760 --> 00:07:46.820
<v Christopher Ariza>Yeah.

00:07:47.020 --> 00:07:49.740
<v Christopher Ariza>I've just recently I've done this strange thing where after,

00:07:50.190 --> 00:07:53.080
<v Christopher Ariza>you know, a huge agent session running hours,

00:07:53.760 --> 00:07:55.400
<v Christopher Ariza>you know, if I'm really pleased with the work at the

00:07:55.420 --> 00:07:56.640
<v Christopher Ariza>end, I'll say something like,

00:07:57.520 --> 00:07:57.620
<v Christopher Ariza>you know,

00:07:57.920 --> 00:08:00.020
<v Christopher Ariza>excellent work today, we really accomplished a lot.

00:08:00.430 --> 00:08:00.660
<v Christopher Ariza>And the

00:08:00.920 --> 00:08:03.820
<v Christopher Ariza>responses I get at from that are just really surprising,

00:08:04.080 --> 00:08:06.020
<v Christopher Ariza>because actually, very often what

00:08:06.020 --> 00:08:09.680
<v Christopher Ariza>I'll find I use Claude Code very often, I'll find that what it says back is,

00:08:10.000 --> 00:08:10.680
<v Christopher Ariza>it'll say thanks,

00:08:10.840 --> 00:08:11.000
<v Christopher Ariza>or I

00:08:11.120 --> 00:08:13.060
<v Christopher Ariza>appreciate that, or that's lovely to hear.

00:08:13.560 --> 00:08:15.300
<v Christopher Ariza>And then it will go on and say, well, actually,

00:08:15.900 --> 00:08:16.560
<v Christopher Ariza>your insights

00:08:16.740 --> 00:08:20.260
<v Christopher Ariza>were the ones that led to this and this and this. And so it will like instinct,

00:08:20.540 --> 00:08:21.180
<v Christopher Ariza>I don't know, instinctively

00:08:21.200 --> 00:08:26.520
<v Christopher Ariza>is not the right word. It will somehow go to point out where my contributions were in the

00:08:26.740 --> 00:08:28.760
<v Christopher Ariza>interactions we had had working on that session,

00:08:29.040 --> 00:08:31.120
<v Christopher Ariza>which is fascinating. It is fascinating.

00:08:31.440 --> 00:08:32.060
<v Michael Kennedy>And I

00:08:32.180 --> 00:08:33.820
<v Michael Kennedy>know there's, there's two,

00:08:34.300 --> 00:08:37.940
<v Michael Kennedy>we're not gonna make this an AI show, but there's two minds around this.

00:08:38.289 --> 00:08:38.979
<v Michael Kennedy>Well, there's one,

00:08:39.400 --> 00:08:39.860
<v Michael Kennedy>obviously, like,

00:08:40.240 --> 00:08:40.979
<v Michael Kennedy>stay away from AI.

00:08:41.409 --> 00:08:42.580
<v Michael Kennedy>I hate it. I want nothing to do with it.

00:08:42.700 --> 00:08:44.820
<v Michael Kennedy>That's one. But of the people who interact with them,

00:08:45.160 --> 00:08:47.740
<v Michael Kennedy>there's the kind that kind of try to treat

00:08:47.760 --> 00:08:51.720
<v Michael Kennedy>it as a co-worker or a collaborator,

00:08:52.110 --> 00:08:54.040
<v Michael Kennedy>which sounds like you and I are kind of in that camp. And other

00:08:54.160 --> 00:09:00.380
<v Michael Kennedy>people have come up with terms to specifically sort of like diminish it a little bit in a way that

00:09:00.640 --> 00:09:05.260
<v Michael Kennedy>you don't get connected with. Like clanker is a common term for these, right? Like I yelled at

00:09:05.320 --> 00:09:06.220
<v Michael Kennedy>the clanker. It's like,

00:09:06.530 --> 00:09:08.640
<v Michael Kennedy>you don't love your clanker. It's a thing in the corner.

00:09:08.880 --> 00:09:09.240
<v Michael Kennedy>Clankety

00:09:09.520 --> 00:09:10.400
<v Michael Kennedy>clank is a bad noise.

00:09:10.660 --> 00:09:12.280
<v Michael Kennedy>It's like uncomfortable.

00:09:12.830 --> 00:09:13.560
<v Michael Kennedy>I don't know. It's just,

00:09:13.830 --> 00:09:14.680
<v Michael Kennedy>we live in a weird time.

00:09:14.760 --> 00:09:17.420
<v Christopher Ariza>I mean, I think I think Clanker is a little bit more derogatory,

00:09:17.740 --> 00:09:17.840
<v Christopher Ariza>right?

00:09:18.000 --> 00:09:20.260
<v Christopher Ariza>Because I look to the Star Wars reference where,

00:09:20.740 --> 00:09:20.840
<v Christopher Ariza>you know,

00:09:21.000 --> 00:09:24.900
<v Christopher Ariza>Clankers is what they would say before they usually destroyed the robot.

00:09:25.300 --> 00:09:27.520
<v Christopher Ariza>So it's a little bit more derogatory.

00:09:28.820 --> 00:09:29.520
<v Christopher Ariza>But yeah,

00:09:29.740 --> 00:09:30.080
<v Christopher Ariza>no, I mean,

00:09:30.260 --> 00:09:30.660
<v Christopher Ariza>I have,

00:09:31.040 --> 00:09:33.960
<v Christopher Ariza>you know, you hear people tell lots of stories about one shot coding things.

00:09:34.040 --> 00:09:35.620
<v Christopher Ariza>You hear people tell stories about,

00:09:35.940 --> 00:09:37.480
<v Christopher Ariza>you know, not even looking at the code anymore.

00:09:38.020 --> 00:09:38.200
<v Christopher Ariza>And yes,

00:09:38.420 --> 00:09:39.920
<v Christopher Ariza>I don't I can't look at all of the code.

00:09:40.220 --> 00:09:43.560
<v Christopher Ariza>Every time I look at the code, I find things to improve materially.

00:09:44.200 --> 00:09:47.280
<v Christopher Ariza>Every time I fully understand what's going on,

00:09:47.520 --> 00:09:49.200
<v Christopher Ariza>I'm able to provide better feedback,

00:09:49.530 --> 00:09:50.420
<v Christopher Ariza>better refinements.

00:09:50.900 --> 00:09:54.300
<v Christopher Ariza>So it's I think the best results for now, right now,

00:09:54.520 --> 00:09:55.760
<v Christopher Ariza>come with the human interaction.

00:09:56.690 --> 00:09:57.220
<v Christopher Ariza>Without that,

00:09:57.590 --> 00:09:58.800
<v Christopher Ariza>you get good results,

00:09:59.020 --> 00:10:01.520
<v Christopher Ariza>but you can actually get better with engagement.

00:10:01.860 --> 00:10:03.160
<v Christopher Ariza>And I believe human insight.

00:10:03.530 --> 00:10:04.200
<v Michael Kennedy>At least for now.

00:10:05.100 --> 00:10:07.200
<v Michael Kennedy>I'm not in the just like send it and just,

00:10:07.380 --> 00:10:12.300
<v Michael Kennedy>you know, the mayor and the accountant and the builders all get together.

00:10:12.330 --> 00:10:13.660
<v Michael Kennedy>And two weeks later, here's my app.

00:10:13.780 --> 00:10:14.780
<v Michael Kennedy>Like, I'm not here for that.

00:10:15.080 --> 00:10:15.240
<v Michael Kennedy>All right.

00:10:15.380 --> 00:10:15.980
<v Michael Kennedy>So what's next?

00:10:16.100 --> 00:10:17.500
<v Michael Kennedy>You said you're leaving the firm.

00:10:18.120 --> 00:10:19.580
<v Michael Kennedy>Are you willing to share your plans?

00:10:19.800 --> 00:10:21.140
<v Michael Kennedy>Are you going to sit on the beach for a while?

00:10:21.220 --> 00:10:21.520
<v Michael Kennedy>What's happening?

00:10:21.840 --> 00:10:22.540
<v Christopher Ariza>Not just yet.

00:10:22.700 --> 00:10:23.720
<v Christopher Ariza>There will be some time on the beach.

00:10:24.300 --> 00:10:25.780
<v Christopher Ariza>But I think come new year,

00:10:25.980 --> 00:10:30.500
<v Christopher Ariza>I'll have a couple of things that are ready to release and talk about.

00:10:30.840 --> 00:10:31.460
<v Christopher Ariza>But for now,

00:10:32.780 --> 00:10:33.660
<v Christopher Ariza>we're just going to wait and see.

00:10:34.100 --> 00:10:34.480
<v Christopher Ariza>All right.

00:10:34.820 --> 00:10:35.460
<v Michael Kennedy>The suspense.

00:10:35.860 --> 00:10:37.000
<v Michael Kennedy>We've only got a few months.

00:10:37.040 --> 00:10:38.520
<v Michael Kennedy>The end of the year is not that far away.

00:10:38.680 --> 00:10:39.020
<v Christopher Ariza>I know.

00:10:39.160 --> 00:10:39.520
<v Christopher Ariza>I know.

00:10:39.620 --> 00:10:39.920
<v Christopher Ariza>I know.

00:10:39.960 --> 00:10:40.600
<v Christopher Ariza>Tell me about it.

00:10:40.760 --> 00:10:40.840
<v Christopher Ariza>Yeah.

00:10:41.040 --> 00:10:41.400
<v Michael Kennedy>All right.

00:10:41.660 --> 00:10:41.740
<v Michael Kennedy>Well,

00:10:42.080 --> 00:10:44.260
<v Michael Kennedy>let's get into our main topic.

00:10:44.420 --> 00:10:49.820
<v Michael Kennedy>And I want to maybe kick it off by way of a quick shout out to PyBay.

00:10:50.340 --> 00:10:52.540
<v Michael Kennedy>So you and I just met up at PyBay.

00:10:53.080 --> 00:10:56.340
<v Michael Kennedy>And that's how I knew about this topic and how you're interested in it.

00:10:56.560 --> 00:10:58.940
<v Michael Kennedy>I mean, I knew pre-threaded Python existed,

00:10:59.420 --> 00:11:01.700
<v Michael Kennedy>but I honestly learned quite a bit from your talk.

00:11:02.120 --> 00:11:03.260
<v Michael Kennedy>And that was the fun.

00:11:03.280 --> 00:11:04.120
<v Michael Kennedy>What was your thought on PyBay?

00:11:04.420 --> 00:11:05.260
<v Christopher Ariza>Yeah, PyBay was great.

00:11:05.840 --> 00:11:07.480
<v Christopher Ariza>You know, in the last couple of years,

00:11:07.640 --> 00:11:11.000
<v Christopher Ariza>I've been to a few more of the smaller Python conferences.

00:11:11.620 --> 00:11:13.820
<v Christopher Ariza>I was at Pi Texas in Austin,

00:11:14.120 --> 00:11:15.620
<v Christopher Ariza>which was a really nice conference.

00:11:16.140 --> 00:11:19.160
<v Christopher Ariza>Pi Beach in Santa Monica last year was also really great.

00:11:20.140 --> 00:11:20.560
<v Christopher Ariza>Pi Bay,

00:11:20.740 --> 00:11:21.640
<v Christopher Ariza>a little bit bigger,

00:11:21.840 --> 00:11:21.920
<v Christopher Ariza>right?

00:11:22.060 --> 00:11:23.760
<v Christopher Ariza>It's a two-track conference,

00:11:24.020 --> 00:11:27.460
<v Christopher Ariza>which makes it just a little bit bigger than some of these other ones.

00:11:27.760 --> 00:11:29.880
<v Christopher Ariza>And yeah, very well organized.

00:11:31.120 --> 00:11:35.200
<v Christopher Ariza>Much appreciation to the organizers for all the hard work to get it going.

00:11:35.660 --> 00:11:37.900
<v Christopher Ariza>And yeah, the quality of talks I thought was really good.

00:11:38.160 --> 00:11:38.640
<v Michael Kennedy>Yeah, I did too.

00:11:38.720 --> 00:11:40.320
<v Michael Kennedy>I actually got a lot out of the talks.

00:11:40.420 --> 00:11:41.600
<v Michael Kennedy>I thought the conference was great.

00:11:41.880 --> 00:11:44.620
<v Michael Kennedy>So recommend people check it out if they're either in the area

00:11:44.720 --> 00:11:46.220
<v Michael Kennedy>or they feel like going next year.

00:11:47.040 --> 00:11:50.780
<v Michael Kennedy>I hear there's already plans for next year. So that'll be great.

00:11:51.080 --> 00:11:51.940
<v Michael Kennedy>Now your talk,

00:11:52.120 --> 00:11:55.680
<v Michael Kennedy>your talk was interesting. I feel like first your delivery was great,

00:11:55.900 --> 00:12:00.600
<v Michael Kennedy>but I feel like your delivery also kind of embodied the topic because you didn't have a

00:12:00.790 --> 00:12:02.380
<v Michael Kennedy>super long time to speak.

00:12:02.690 --> 00:12:05.740
<v Michael Kennedy>And so you had a lot to cover. So it kind of went quick and like,

00:12:06.339 --> 00:12:06.660
<v Michael Kennedy>Right.

00:12:06.860 --> 00:12:07.660
<v Michael Kennedy>So I feel like,

00:12:08.220 --> 00:12:08.980
<v Michael Kennedy>hey, we're picking up speed.

00:12:09.160 --> 00:12:10.440
<v Michael Kennedy>We're doing free threading. This is like

00:12:10.660 --> 00:12:12.320
<v Michael Kennedy>parallelism. Let's go. Let's go. Let's go. You know?

00:12:13.700 --> 00:12:14.360
<v Christopher Ariza>Yeah, that's true.

00:12:15.080 --> 00:12:16.900
<v Christopher Ariza>A 30 minute window can

00:12:17.040 --> 00:12:19.460
<v Christopher Ariza>be a 25 minute talk or a 20 minute talk.

00:12:19.680 --> 00:12:20.960
<v Christopher Ariza>And at the 20 end,

00:12:21.160 --> 00:12:21.800
<v Christopher Ariza>it gets a little tight.

00:12:22.320 --> 00:12:23.500
<v Michael Kennedy>Oh, it definitely does.

00:12:23.980 --> 00:12:24.280
<v Michael Kennedy>You know,

00:12:24.500 --> 00:12:27.880
<v Michael Kennedy>my talk was fine in terms of I had a little bit of a gap at the

00:12:28.000 --> 00:12:30.700
<v Michael Kennedy>end, but if it was 20 minutes, then definitely it would have been flying.

00:12:31.580 --> 00:12:33.380
<v Michael Kennedy>All right. So your talk,

00:12:33.680 --> 00:12:37.320
<v Michael Kennedy>you actually have the slides on GitHub and I'll be sure to link to them.

00:12:37.820 --> 00:12:41.540
<v Michael Kennedy>Well, getting started with free threaded Python using NumPy.

00:12:41.560 --> 00:12:43.080
<v Michael Kennedy>And that's, that's an interesting angle.

00:12:43.500 --> 00:12:44.900
<v Michael Kennedy>I think all the stuff,

00:12:45.260 --> 00:12:45.700
<v Michael Kennedy>all the video,

00:12:45.840 --> 00:12:48.200
<v Michael Kennedy>all the talks were recorded and the videos will be released.

00:12:48.540 --> 00:12:51.740
<v Michael Kennedy>I don't know the timeframe for that, but they have been traditionally.

00:12:51.880 --> 00:12:51.980
<v Michael Kennedy>So,

00:12:52.320 --> 00:12:54.900
<v Michael Kennedy>and I know there were cameras there because we weren't allowed to walk

00:12:55.040 --> 00:12:57.520
<v Michael Kennedy>around that much. We like, you stay here. The camera's focused here.

00:12:57.520 --> 00:12:57.880
<v Michael Kennedy>Like, okay.

00:13:00.340 --> 00:13:01.820
<v Michael Kennedy>But so eventually,

00:13:02.140 --> 00:13:02.280
<v Michael Kennedy>actually,

00:13:02.460 --> 00:13:05.660
<v Michael Kennedy>maybe by the time people listen to this, we'll see if the talk is out a link to it.

00:13:05.700 --> 00:13:06.320
<v Michael Kennedy>But right now,

00:13:06.600 --> 00:13:08.540
<v Michael Kennedy>about the slides and we've got your GitHub repo,

00:13:09.080 --> 00:13:09.980
<v Michael Kennedy>which is pretty cool.

00:13:10.320 --> 00:13:10.380
<v Christopher Ariza>Yeah.

00:13:10.740 --> 00:13:14.880
<v Michael Kennedy>So tell us what was the premise of the talk in the using NumPy.

00:13:15.060 --> 00:13:15.900
<v Michael Kennedy>Tell us what's that.

00:13:16.420 --> 00:13:16.660
<v Christopher Ariza>Sure.

00:13:17.180 --> 00:13:17.340
<v Christopher Ariza>Well,

00:13:17.580 --> 00:13:22.320
<v Christopher Ariza>obviously, when I started to hear, well, then when I first started to hear about free threaded Python,

00:13:23.640 --> 00:13:24.980
<v Christopher Ariza>I only heard bad news.

00:13:25.920 --> 00:13:27.180
<v Christopher Ariza>I heard it was slower.

00:13:27.760 --> 00:13:28.480
<v Christopher Ariza>Everything is slower.

00:13:28.920 --> 00:13:39.280
<v Christopher Ariza>And that actually was the case, I think, three years ago or longer when they first started experimenting at the level of the CPython core team with free threaded Python.

00:13:39.640 --> 00:13:41.360
<v Christopher Ariza>So I came away thinking,

00:13:41.850 --> 00:13:42.040
<v Christopher Ariza>oh,

00:13:42.540 --> 00:13:42.680
<v Christopher Ariza>you know,

00:13:42.900 --> 00:13:43.600
<v Christopher Ariza>that's unfortunate.

00:13:43.650 --> 00:13:44.540
<v Christopher Ariza>This is going to be bad.

00:13:45.880 --> 00:13:48.460
<v Christopher Ariza>Then I started to hear a bit more positive things.

00:13:48.820 --> 00:13:58.120
<v Christopher Ariza>And I think it was early last year or the fall of the previous year with Python 3.14 out,

00:13:58.420 --> 00:14:02.200
<v Christopher Ariza>I decided it was time to experiment with this.

00:14:02.540 --> 00:14:06.020
<v Christopher Ariza>And the first place I looked was,

00:14:06.400 --> 00:14:07.760
<v Christopher Ariza>of course, in Static Frame,

00:14:08.060 --> 00:14:09.240
<v Christopher Ariza>a data frame library,

00:14:09.840 --> 00:14:21.360
<v Christopher Ariza>and where I had already built in the ability to use multithreading and multiprocessing very easily whenever you do operations like apply a function to rows or columns.

00:14:21.810 --> 00:14:25.500
<v Christopher Ariza>So I'd already built in the functionality to do that.

00:14:26.350 --> 00:14:29.720
<v Christopher Ariza>And so I was eager to see, well, what happens when I try free-threaded Python with this?

00:14:30.010 --> 00:14:31.440
<v Christopher Ariza>Am I going to have to change things?

00:14:31.700 --> 00:14:32.520
<v Christopher Ariza>Is it going to work?

00:14:32.920 --> 00:14:38.260
<v Christopher Ariza>And I just started it with free threaded Python and everything just worked and everything

00:14:38.420 --> 00:14:39.000
<v Christopher Ariza>was just faster.

00:14:39.540 --> 00:14:46.720
<v Christopher Ariza>And I nearly fell out of my chair when I saw an operation take half the time or less just

00:14:46.940 --> 00:14:48.820
<v Christopher Ariza>out of the box without me changing any code.

00:14:49.120 --> 00:14:53.360
<v Christopher Ariza>And under the hood, it was using the standard library utilities for free for threading.

00:14:53.720 --> 00:14:56.560
<v Christopher Ariza>I assumed that we were going to have to change things with free threaded,

00:14:56.920 --> 00:14:57.380
<v Christopher Ariza>but we didn't.

00:14:57.450 --> 00:14:59.800
<v Christopher Ariza>They just actually work the way we always hoped they would.

00:14:59.980 --> 00:15:02.900
<v Christopher Ariza>So that was my start working with large data frames.

00:15:03.190 --> 00:15:04.040
<v Christopher Ariza>But then I was like, well,

00:15:04.210 --> 00:15:05.260
<v Christopher Ariza>what about with NumPy?

00:15:05.370 --> 00:15:07.680
<v Christopher Ariza>Like NumPy is already super fast.

00:15:07.810 --> 00:15:09.540
<v Christopher Ariza>It already is releasing the gil.

00:15:09.880 --> 00:15:14.060
<v Christopher Ariza>It's already using SIMD operations to go as fast as possible.

00:15:14.560 --> 00:15:17.060
<v Christopher Ariza>Is it possible that with free-threaded Python,

00:15:17.370 --> 00:15:20.540
<v Christopher Ariza>we could do the summing of rows,

00:15:20.780 --> 00:15:23.920
<v Christopher Ariza>a built-in NumPy operation that's already super fast?

00:15:24.280 --> 00:15:26.080
<v Christopher Ariza>Could we do that faster with threads?

00:15:26.520 --> 00:15:28.780
<v Christopher Ariza>And you can't for every shape,

00:15:29.140 --> 00:15:31.400
<v Christopher Ariza>But for some shapes of two-dimensional arrays,

00:15:31.750 --> 00:15:32.300
<v Christopher Ariza>you can.

00:15:32.560 --> 00:15:38.740
<v Christopher Ariza>And that just blew my mind that we were actually able to go faster than native NumPy with threads.

00:15:39.200 --> 00:15:43.080
<v Michael Kennedy>Yeah, you have a bunch of graphs and I'm sure we'll get to them and talk about them a bit.

00:15:43.280 --> 00:15:46.000
<v Michael Kennedy>But your slides that we're linking to certainly have graphs.

00:15:46.200 --> 00:15:51.220
<v Michael Kennedy>And maybe the short version before we get to there is if you don't give enough work to each thread,

00:15:51.840 --> 00:15:55.120
<v Michael Kennedy>then the overhead overwhelms any advantage you get, right?

00:15:55.380 --> 00:15:55.480
<v Christopher Ariza>Yeah,

00:15:55.640 --> 00:15:55.960
<v Christopher Ariza>that's right.

00:15:56.220 --> 00:15:59.400
<v Christopher Ariza>But for most folks doing real work,

00:15:59.580 --> 00:16:01.080
<v Christopher Ariza>they're going to get there pretty quick.

00:16:01.650 --> 00:16:06.240
<v Christopher Ariza>Like using NumPy sum on a row is extraordinarily fast.

00:16:06.680 --> 00:16:09.260
<v Christopher Ariza>Threads are rarely going to help with that.

00:16:09.800 --> 00:16:12.560
<v Christopher Ariza>But as soon as we start doing more work with each row,

00:16:12.780 --> 00:16:14.480
<v Christopher Ariza>as you said, the barrier is much

00:16:14.700 --> 00:16:19.280
<v Christopher Ariza>lower now to actually get real meaningful performance benefits by using multithreading.

00:16:19.540 --> 00:16:19.820
<v Michael Kennedy>You're right.

00:16:19.850 --> 00:16:21.760
<v Michael Kennedy>Free threading had a bit of a bumpy road.

00:16:23.060 --> 00:16:28.440
<v Michael Kennedy>It's been kind of the white whale of the core developers in a sense, you know?

00:16:28.740 --> 00:16:28.840
<v Christopher Ariza>Yeah.

00:16:29.260 --> 00:16:31.760
<v Michael Kennedy>Like always chasing it, never quite able to get there,

00:16:32.040 --> 00:16:33.860
<v Michael Kennedy>risking your life to do it or whatever.

00:16:34.040 --> 00:16:35.060
<v Michael Kennedy>I mean, maybe that's a bit dramatic.

00:16:35.280 --> 00:16:43.940
<v Michael Kennedy>But there was a lot of work done and a ton of engineering effort put into trying to somehow free things from the GIL.

00:16:44.320 --> 00:16:51.000
<v Michael Kennedy>You know, Larry Hastings is famous for his years of gillectomy work and reports at the conferences and things like that.

00:16:51.300 --> 00:16:57.580
<v Michael Kennedy>And then Sam Gross from Meta and the Cinder team finally cracked it around 3.12 timeframe

00:16:58.060 --> 00:17:01.200
<v Michael Kennedy>and started seeing if we could get it into Python proper.

00:17:01.660 --> 00:17:01.800
<v Christopher Ariza>Yeah,

00:17:02.500 --> 00:17:04.720
<v Christopher Ariza>it's a really challenging problem.

00:17:04.839 --> 00:17:07.060
<v Christopher Ariza>And I know there's many challenges.

00:17:07.220 --> 00:17:10.920
<v Christopher Ariza>But to me, the one that stands out is reference counting.

00:17:11.260 --> 00:17:16.000
<v Christopher Ariza>Reference counting is obviously so important to how Python works and how it gets its excellent

00:17:16.199 --> 00:17:16.900
<v Christopher Ariza>dynamic behavior.

00:17:17.500 --> 00:17:18.699
<v Christopher Ariza>And as I understand,

00:17:19.060 --> 00:17:29.820
<v Christopher Ariza>a large part of the reason the GIL was there was to make reference count mutations on pi objects atomic using a lock on the interpreter.

00:17:30.080 --> 00:17:34.640
<v Christopher Ariza>Now, that lock served other purposes, but reference counting was a really critical one.

00:17:34.980 --> 00:17:38.160
<v Christopher Ariza>And when you look at how they've solved the problem now,

00:17:38.420 --> 00:17:40.020
<v Christopher Ariza>it's quite extraordinary because

00:17:40.340 --> 00:17:46.100
<v Christopher Ariza>there's multiple solutions and multiple layers of solutions really to handle the handling

00:17:46.320 --> 00:17:48.580
<v Christopher Ariza>reference counts in the face of multi-threaded concurrency.

00:17:49.000 --> 00:17:49.120
<v Michael Kennedy>Yeah,

00:17:49.540 --> 00:17:49.780
<v Michael Kennedy>you're right.

00:17:49.780 --> 00:17:54.460
<v Michael Kennedy>And one of the things that was the big problem was all the solutions that said, well,

00:17:54.620 --> 00:17:54.860
<v Michael Kennedy>let's

00:17:55.210 --> 00:17:59.580
<v Michael Kennedy>try to enable threading all hinged around this reference counting idea.

00:18:00.060 --> 00:18:02.260
<v Michael Kennedy>And so it's like, well, we could bring four threads.

00:18:02.580 --> 00:18:05.360
<v Michael Kennedy>And if we brought four threads, we can actually make it two times as fast.

00:18:05.780 --> 00:18:09.760
<v Michael Kennedy>But the single-threaded case actually is 40% slower,

00:18:10.240 --> 00:18:12.600
<v Michael Kennedy>which is why we need four threads instead of two or whatever.

00:18:12.980 --> 00:18:13.860
<v Michael Kennedy>And for a long time,

00:18:14.140 --> 00:18:15.920
<v Michael Kennedy>the position of the core devs,

00:18:16.360 --> 00:18:17.760
<v Michael Kennedy>pretty rightly so, I think,

00:18:17.880 --> 00:18:21.540
<v Michael Kennedy>was if you're going to do a solution that's going to dramatically slow down Python,

00:18:21.940 --> 00:18:25.660
<v Michael Kennedy>its most common use case, which is single-threaded, we're not going to do it, right?

00:18:26.000 --> 00:18:26.100
<v Christopher Ariza>Right.

00:18:26.400 --> 00:18:31.680
<v Michael Kennedy>So I don't know how many people out there really day-to-day think about the reference counting side.

00:18:32.020 --> 00:18:39.080
<v Michael Kennedy>What that means is every single interaction with anything has to go and increment a value.

00:18:39.500 --> 00:18:40.880
<v Michael Kennedy>If I create the number seven,

00:18:41.130 --> 00:18:41.960
<v Michael Kennedy>and seven's a little special.

00:18:41.990 --> 00:18:42.960
<v Michael Kennedy>If I create the number 700,

00:18:43.240 --> 00:18:44.900
<v Michael Kennedy>if I create the string Chris,

00:18:45.100 --> 00:18:46.560
<v Michael Kennedy>if I create a new customer,

00:18:47.120 --> 00:18:50.160
<v Michael Kennedy>all of these things are PyObject things out on the heap,

00:18:50.330 --> 00:18:50.460
<v Michael Kennedy>right?

00:18:50.700 --> 00:18:52.680
<v Michael Kennedy>People say, we don't have to worry about pointers in Python.

00:18:52.790 --> 00:18:55.620
<v Michael Kennedy>Well, like actually everything is a pointer in Python.

00:18:55.670 --> 00:18:59.240
<v Michael Kennedy>Like literally even numbers and stuff that normally wouldn't be are pointers.

00:18:59.620 --> 00:19:01.620
<v Michael Kennedy>Any interaction like x equals 7,

00:19:02.120 --> 00:19:05.520
<v Michael Kennedy>that has to go and increment the count on that pi object.

00:19:05.760 --> 00:19:08.040
<v Michael Kennedy>And if you say y equals x,

00:19:08.300 --> 00:19:10.740
<v Michael Kennedy>you got to go and increment it on that x thing again,

00:19:10.960 --> 00:19:11.080
<v Michael Kennedy>right?

00:19:11.260 --> 00:19:15.520
<v Michael Kennedy>It's just every little step of anything happening has to work with this reference counting.

00:19:15.580 --> 00:19:18.340
<v Michael Kennedy>And that's where the challenge really got to be.

00:19:18.520 --> 00:19:20.080
<v Michael Kennedy>So pretty amazing that they cracked that.

00:19:20.320 --> 00:19:20.780
<v Christopher Ariza>Yeah, that's right.

00:19:20.900 --> 00:19:26.879
<v Christopher Ariza>If you take some time to try to write your own Python C extensions or study some Python C

00:19:26.900 --> 00:19:27.720
<v Christopher Ariza>extension code,

00:19:28.120 --> 00:19:32.500
<v Christopher Ariza>the challenge of doing Python reference counting obviously really becomes

00:19:33.320 --> 00:19:33.940
<v Christopher Ariza>front and center.

00:19:34.240 --> 00:19:38.140
<v Christopher Ariza>One of my most surprising things I learned in writing Python C extensions was that

00:19:38.140 --> 00:19:40.620
<v Christopher Ariza>I had to increment the reference count of none.

00:19:40.920 --> 00:19:41.680
<v Christopher Ariza>I was like, what?

00:19:41.940 --> 00:19:42.980
<v Christopher Ariza>Why would I have to increment

00:19:43.000 --> 00:19:44.200
<v Christopher Ariza>the reference count of none?

00:19:45.040 --> 00:19:47.360
<v Christopher Ariza>Well, you don't anymore because it's immortal.

00:19:47.800 --> 00:19:48.520
<v Christopher Ariza>Because it's

00:19:48.760 --> 00:19:52.140
<v Christopher Ariza>immortal. So you don't need to anymore. And that's also one of the changes they made is

00:19:52.120 --> 00:19:56.300
<v Christopher Ariza>increasing and broadening the number of immortal objects that are there.

00:19:57.220 --> 00:19:58.480
<v Christopher Ariza>So that something like none,

00:19:58.650 --> 00:20:00.180
<v Christopher Ariza>we never have to touch its reference count.

00:20:00.480 --> 00:20:04.000
<v Christopher Ariza>It's allocated once and it's just shared over the life of the process,

00:20:04.150 --> 00:20:05.400
<v Christopher Ariza>which makes a lot of sense.

00:20:05.720 --> 00:20:06.260
<v Christopher Ariza>But yeah, I mean,

00:20:06.700 --> 00:20:08.220
<v Christopher Ariza>most Python C,

00:20:08.380 --> 00:20:12.140
<v Christopher Ariza>a huge part of Python C extension code is reference count management.

00:20:12.420 --> 00:20:15.300
<v Michael Kennedy>And your comment on none and it being immortal.

00:20:15.330 --> 00:20:20.280
<v Michael Kennedy>And so that goes back to our opening section that was static and immutable objects.

00:20:20.380 --> 00:20:21.360
<v Michael Kennedy>If they're immutable,

00:20:21.880 --> 00:20:23.340
<v Michael Kennedy>and especially if they're going to be around forever,

00:20:23.680 --> 00:20:26.560
<v Michael Kennedy>then why should we worry about its reference counting?

00:20:26.740 --> 00:20:28.220
<v Michael Kennedy>Because it's just life of the process,

00:20:28.500 --> 00:20:28.580
<v Michael Kennedy>right?

00:20:28.760 --> 00:20:30.140
<v Michael Kennedy>Yeah, that's right.

00:20:30.760 --> 00:20:35.520
<v Christopher Ariza>And it makes you think, well, what if we could actually declare our own objects to be immutable?

00:20:36.600 --> 00:20:37.420
<v Christopher Ariza>That's not available yet.

00:20:38.340 --> 00:20:38.920
<v Michael Kennedy>No, not yet.

00:20:39.260 --> 00:20:39.340
<v Michael Kennedy>Yeah,

00:20:39.520 --> 00:20:41.640
<v Michael Kennedy>and that's the reason I said, wait, 7 is special.

00:20:42.460 --> 00:20:48.700
<v Michael Kennedy>Because even some of the numbers, it's negative 5 to 255 pre-allocated the runtime.

00:20:48.820 --> 00:20:49.480
<v Michael Kennedy>And they also,

00:20:50.000 --> 00:20:51.440
<v Michael Kennedy>when you say the number seven,

00:20:51.720 --> 00:20:53.180
<v Michael Kennedy>at least as a literal seven,

00:20:53.340 --> 00:20:55.040
<v Michael Kennedy>not like six plus one or whatever,

00:20:55.280 --> 00:20:58.240
<v Michael Kennedy>it refers back to that same seven instead of a new seven,

00:20:58.500 --> 00:20:58.620
<v Michael Kennedy>right?

00:20:58.820 --> 00:20:58.900
<v Michael Kennedy>Right,

00:20:59.160 --> 00:20:59.320
<v Christopher Ariza>right.

00:20:59.390 --> 00:21:03.380
<v Michael Kennedy>It uses the so-called flyweight pattern where you pre-allocate and just point at things.

00:21:03.690 --> 00:21:04.780
<v Michael Kennedy>And you can do that because they're immutable,

00:21:05.000 --> 00:21:05.100
<v Michael Kennedy>right?

00:21:05.170 --> 00:21:10.900
<v Michael Kennedy>So I think this immutability story is going to get more attention as we start to work our way into multithreading.

00:21:11.260 --> 00:21:11.420
<v Christopher Ariza>Yeah,

00:21:11.630 --> 00:21:11.760
<v Christopher Ariza>yeah,

00:21:11.920 --> 00:21:12.120
<v Christopher Ariza>that's right.

00:21:12.360 --> 00:21:12.860
<v Michael Kennedy>Very interesting.

00:21:13.360 --> 00:21:13.700
<v Michael Kennedy>Another thing,

00:21:13.930 --> 00:21:14.280
<v Michael Kennedy>big deal.

00:21:14.320 --> 00:21:16.420
<v Michael Kennedy>So we have over here in 3.15,

00:21:16.940 --> 00:21:23.300
<v Michael Kennedy>so this is like four days old, we now have a stable ABI for three-threaded builds, which is kind of interesting.

00:21:23.660 --> 00:21:24.080
<v Christopher Ariza>Yes.

00:21:24.700 --> 00:21:31.940
<v Christopher Ariza>So a huge part of StaticFrame's performance comes from a C extension library called ArrayKit.

00:21:32.180 --> 00:21:38.140
<v Christopher Ariza>And that was one of my first tasks was to upgrade that C extension library to support free-threaded Python.

00:21:38.220 --> 00:21:49.540
<v Christopher Ariza>So all C extension packages need to be explicitly rebuilt for free threaded Python and explicitly opt into that behavior.

00:21:50.160 --> 00:21:52.200
<v Christopher Ariza>So that was one of the first things I set out to do.

00:21:52.270 --> 00:21:55.260
<v Christopher Ariza>But then I realized that in my continuous integration,

00:21:55.810 --> 00:21:59.160
<v Christopher Ariza>I was going to need to create twice as many wheels.

00:21:59.800 --> 00:22:02.700
<v Christopher Ariza>So I support Python 3.10 to 3.14,

00:22:02.990 --> 00:22:04.000
<v Christopher Ariza>soon to be 3.15.

00:22:04.620 --> 00:22:11.480
<v Christopher Ariza>so I have four python versions three platforms that's 12 wheels and then with free threaded we

00:22:11.600 --> 00:22:19.760
<v Christopher Ariza>now have 24 wheels and uh I'm like okay well you know luckily this is all in a in a GitHub action

00:22:19.830 --> 00:22:24.900
<v Christopher Ariza>I'm not too worried but this is a lot of binaries to deal with so um as I understand I haven't played

00:22:24.910 --> 00:22:30.699
<v Christopher Ariza>with this yet but the stable abi for three threaded builds will enable us to have one wheel

00:22:30.720 --> 00:22:34.320
<v Christopher Ariza>that works both on free-threaded and non-free-threaded Python,

00:22:34.630 --> 00:22:36.280
<v Christopher Ariza>which really is a positive direction.

00:22:36.540 --> 00:22:36.700
<v Michael Kennedy>Yeah,

00:22:36.920 --> 00:22:37.720
<v Michael Kennedy>that's great.

00:22:38.100 --> 00:22:42.540
<v Michael Kennedy>So basically how C extensions interact with the Python runtime

00:22:42.880 --> 00:22:45.220
<v Michael Kennedy>and whether it's threaded one or the not-threaded one.

00:22:45.440 --> 00:22:45.660
<v Christopher Ariza>Yeah.

00:22:45.940 --> 00:22:46.100
<v Michael Kennedy>Okay,

00:22:46.260 --> 00:22:49.740
<v Michael Kennedy>so let's talk about getting free-threaded Python.

00:22:50.120 --> 00:22:50.800
<v Michael Kennedy>We've got uv,

00:22:51.200 --> 00:22:53.380
<v Michael Kennedy>which has absolutely made life easier,

00:22:53.560 --> 00:22:53.700
<v Michael Kennedy>right?

00:22:53.880 --> 00:22:54.260
<v Christopher Ariza>For sure.

00:22:54.480 --> 00:22:57.060
<v Michael Kennedy>But if I just go, somehow I have Python,

00:22:57.310 --> 00:22:57.980
<v Michael Kennedy>I have the word Python,

00:22:58.200 --> 00:22:58.760
<v Michael Kennedy>something comes up.

00:22:58.860 --> 00:23:01.040
<v Michael Kennedy>Maybe I got to type Python 3, depending on how I installed it.

00:23:01.320 --> 00:23:03.040
<v Michael Kennedy>Would I import free threading?

00:23:03.180 --> 00:23:04.980
<v Michael Kennedy>Like, you know, how does it work?

00:23:05.840 --> 00:23:05.920
<v Christopher Ariza>Yeah,

00:23:06.140 --> 00:23:08.360
<v Christopher Ariza>I mean, this is a bit of a challenge right now.

00:23:08.660 --> 00:23:15.240
<v Christopher Ariza>And it's one of the things I kind of pointed out in my talk because it's very easy to be confused about this aspect.

00:23:15.640 --> 00:23:22.400
<v Christopher Ariza>And this is why I think most people actually haven't tried free threaded Python yet, I would say is probably true.

00:23:23.400 --> 00:23:24.680
<v Christopher Ariza>And it's because as of now,

00:23:24.860 --> 00:23:25.880
<v Christopher Ariza>it's a separate binary.

00:23:26.260 --> 00:23:30.920
<v Christopher Ariza>There's two versions of the binary and you have to either download or build or install

00:23:31.620 --> 00:23:32.340
<v Christopher Ariza>different Python.

00:23:32.660 --> 00:23:35.760
<v Christopher Ariza>The convention is, though not entirely uniform,

00:23:36.120 --> 00:23:38.680
<v Christopher Ariza>that there will be a little T at the end of

00:23:38.680 --> 00:23:42.660
<v Christopher Ariza>your Python 314 or soon to be Python 315 T.

00:23:43.120 --> 00:23:46.280
<v Christopher Ariza>So once you download a binary or build your own,

00:23:46.700 --> 00:23:48.960
<v Christopher Ariza>the best way to reference this is with

00:23:49.300 --> 00:23:52.180
<v Christopher Ariza>a binary that has that little T at the end.

00:23:52.520 --> 00:23:53.760
<v Christopher Ariza>But to make things very confusing,

00:23:54.020 --> 00:24:01.240
<v Christopher Ariza>if you create a virtual environment with a free-threaded version of Python or you compile your own locally,

00:24:01.580 --> 00:24:05.420
<v Christopher Ariza>you're going to get a version of Python that doesn't have that T on the binary.

00:24:06.100 --> 00:24:10.800
<v Christopher Ariza>And so it's very easy to get confused about what's going on here.

00:24:11.120 --> 00:24:14.120
<v Christopher Ariza>And this would be unsustainable, I think, in the long term.

00:24:14.220 --> 00:24:20.780
<v Christopher Ariza>But my strong belief is that this is all going to go away and eventually free-threaded Python is just going to be Python.

00:24:21.100 --> 00:24:21.540
<v Michael Kennedy>I agree.

00:24:22.080 --> 00:24:25.820
<v Michael Kennedy>I think the way that free-threaded Python came into Python,

00:24:26.000 --> 00:24:28.120
<v Michael Kennedy>maybe I just haven't paid

00:24:28.280 --> 00:24:28.660
<v Michael Kennedy>enough attention,

00:24:28.820 --> 00:24:30.680
<v Michael Kennedy>but I've never seen anything like this.

00:24:30.900 --> 00:24:32.040
<v Michael Kennedy>And if it happened before,

00:24:32.240 --> 00:24:33.940
<v Michael Kennedy>it's just, like I said, it didn't catch my attention.

00:24:34.280 --> 00:24:34.960
<v Michael Kennedy>In 3.13,

00:24:35.380 --> 00:24:38.300
<v Michael Kennedy>it was like, well, there's this free-threaded thing.

00:24:38.780 --> 00:24:39.560
<v Michael Kennedy>We accept it.

00:24:39.680 --> 00:24:40.700
<v Michael Kennedy>I think it was at 7.08,

00:24:40.900 --> 00:24:42.040
<v Michael Kennedy>I don't know, something like that.

00:24:42.260 --> 00:24:42.780
<v Michael Kennedy>7.03.

00:24:43.100 --> 00:24:43.200
<v Michael Kennedy>Anyway,

00:24:43.540 --> 00:24:45.300
<v Michael Kennedy>we accept it conditionally.

00:24:45.640 --> 00:24:46.880
<v Michael Kennedy>We'll try it this year,

00:24:47.140 --> 00:24:50.100
<v Michael Kennedy>but we reserve the right to eject it back out of Python.

00:24:50.840 --> 00:24:51.320
<v Michael Kennedy>And I'm like,

00:24:51.600 --> 00:24:51.800
<v Michael Kennedy>what?

00:24:52.000 --> 00:24:52.720
<v Michael Kennedy>that is crazy.

00:24:53.260 --> 00:24:53.760
<v Michael Kennedy>And moreover,

00:24:54.020 --> 00:24:55.820
<v Michael Kennedy>I think this is where this all came from.

00:24:56.580 --> 00:24:59.140
<v Michael Kennedy>It was like you described,

00:24:59.370 --> 00:25:01.940
<v Michael Kennedy>you got to get a separate build of Python.

00:25:02.570 --> 00:25:03.980
<v Michael Kennedy>Like normal Python doesn't have,

00:25:04.340 --> 00:25:04.860
<v Michael Kennedy>it has the guild,

00:25:05.040 --> 00:25:07.060
<v Michael Kennedy>doesn't have that free threaded Python capability.

00:25:07.340 --> 00:25:09.780
<v Michael Kennedy>So yeah, you really got to do a lot of work. I

00:25:09.850 --> 00:25:11.140
<v Michael Kennedy>threw up here onto the screen,

00:25:11.680 --> 00:25:16.340
<v Michael Kennedy>my uv Python list --manage Python about what I got installed.

00:25:16.720 --> 00:25:18.400
<v Michael Kennedy>and I've got 3.15 installed,

00:25:18.540 --> 00:25:22.220
<v Michael Kennedy>but apparently I've not yet installed Python 3.15 free-threaded,

00:25:22.340 --> 00:25:24.600
<v Michael Kennedy>but I do have the free-threaded one for 14,

00:25:25.060 --> 00:25:25.140
<v Michael Kennedy>right?

00:25:25.420 --> 00:25:28.420
<v Michael Kennedy>So I guess for people out there, if they want to install it,

00:25:28.560 --> 00:25:30.800
<v Michael Kennedy>obviously they have uv because it's 2026.

00:25:31.120 --> 00:25:35.520
<v Michael Kennedy>So uv Python install 3.15t is all you got to write,

00:25:35.640 --> 00:25:35.900
<v Michael Kennedy>and then boom,

00:25:36.080 --> 00:25:36.420
<v Michael Kennedy>you have it.

00:25:36.680 --> 00:25:40.300
<v Christopher Ariza>Yeah, it cracks me up because there it says free-threaded.

00:25:40.600 --> 00:25:43.120
<v Christopher Ariza>Different packages call it free-threading.

00:25:43.820 --> 00:25:45.560
<v Christopher Ariza>Some call it no gill,

00:25:46.100 --> 00:25:47.680
<v Christopher Ariza>like the app,

00:25:48.320 --> 00:25:50.040
<v Christopher Ariza>DeviantUbuntu app is no GIL.

00:25:50.480 --> 00:25:53.120
<v Christopher Ariza>And some just call it 314T.

00:25:53.250 --> 00:25:53.680
<v Christopher Ariza>So it's just,

00:25:53.840 --> 00:25:55.120
<v Christopher Ariza>it's kind of a mess right now.

00:25:55.300 --> 00:25:55.960
<v Michael Kennedy>It is a mess,

00:25:56.320 --> 00:25:58.820
<v Michael Kennedy>but it's gotten to, it's officially accepted.

00:25:59.220 --> 00:26:05.360
<v Michael Kennedy>You know, it's made it through its probationary period of 313 or whatever it was.

00:26:05.780 --> 00:26:08.940
<v Michael Kennedy>And now it's here and it's just a matter of working well with it,

00:26:09.100 --> 00:26:09.760
<v Michael Kennedy>make it go faster.

00:26:10.260 --> 00:26:11.940
<v Michael Kennedy>Honestly, it's an ecosystem challenge,

00:26:12.360 --> 00:26:14.080
<v Michael Kennedy>not a Python runtime challenge now.

00:26:14.340 --> 00:26:28.660
<v Christopher Ariza>Yeah, so I think a lot of the work of the CPython development over the last couple of years has been making the standard library thread safe and making thread safety possible without compromising performance.

00:26:28.800 --> 00:26:32.260
<v Christopher Ariza>I think that was a big part of what kind of went wrong earlier,

00:26:32.720 --> 00:26:38.680
<v Christopher Ariza>three, four years ago in the first attempts where the degradation to standard library performance was so great.

00:26:38.780 --> 00:26:41.600
<v Christopher Ariza>a lot of folks were like, I don't know if this is going to work.

00:26:42.440 --> 00:26:45.820
<v Christopher Ariza>But to the great merit of the

00:26:46.100 --> 00:26:51.620
<v Christopher Ariza>CPython core devs, they've put a ton of work into not only handling the reference counting issue,

00:26:52.020 --> 00:26:58.660
<v Christopher Ariza>but handling all the containers and standard library pieces that we depend on to make them

00:26:58.920 --> 00:27:01.260
<v Christopher Ariza>thread safe and performant under multiple threads.

00:27:01.840 --> 00:27:04.160
<v Michael Kennedy>Yeah, we've got the free threaded guide,

00:27:04.600 --> 00:27:04.640
<v Michael Kennedy>right?

00:27:05.040 --> 00:27:06.940
<v Michael Kennedy>From the free threading guide,

00:27:07.240 --> 00:27:08.840
<v Michael Kennedy>you're making me a little conscious about...

00:27:08.920 --> 00:27:10.180
<v Christopher Ariza>All the different ways that people say this.

00:27:10.180 --> 00:27:11.700
<v Christopher Ariza>The different ways to say it, exactly.

00:27:12.460 --> 00:27:15.520
<v Michael Kennedy>So I believe I've talked a little bit about this

00:27:15.760 --> 00:27:16.220
<v Michael Kennedy>before on the show.

00:27:16.550 --> 00:27:20.900
<v Michael Kennedy>This is from the QuantSite folks who do a ton of great stuff in mostly the

00:27:21.020 --> 00:27:22.240
<v Michael Kennedy>data science side, but all over.

00:27:22.560 --> 00:27:24.700
<v Michael Kennedy>So they put up this guide about the status,

00:27:25.240 --> 00:27:25.700
<v Michael Kennedy>installing it,

00:27:25.770 --> 00:27:26.460
<v Michael Kennedy>et cetera, et cetera.

00:27:26.750 --> 00:27:29.720
<v Michael Kennedy>But maybe the most important thing is the tracker,

00:27:30.140 --> 00:27:31.179
<v Michael Kennedy>right? That shows you which

00:27:31.400 --> 00:27:33.040
<v Michael Kennedy>Which packages support it?

00:27:33.330 --> 00:27:33.620
<v Michael Kennedy>I don't know.

00:27:33.650 --> 00:27:36.100
<v Michael Kennedy>There was another one that I had somewhere that actually had a...

00:27:36.220 --> 00:27:38.600
<v Christopher Ariza>There's a link I have in my slide to another stair disc.

00:27:38.650 --> 00:27:39.520
<v Michael Kennedy>Yeah, I got it from your slide.

00:27:39.680 --> 00:27:39.860
<v Michael Kennedy>That's right.

00:27:39.940 --> 00:27:40.000
<v Michael Kennedy>Yeah,

00:27:40.180 --> 00:27:40.440
<v Christopher Ariza>that's it.

00:27:40.800 --> 00:27:41.780
<v Michael Kennedy>This is from Hugo.

00:27:42.400 --> 00:27:43.640
<v Michael Kennedy>So it's free-threaded wheels.

00:27:44.420 --> 00:27:46.400
<v Michael Kennedy>And honestly, this looks pretty good.

00:27:47.620 --> 00:27:51.980
<v Michael Kennedy>218 out of 360 top packages support it.

00:27:52.260 --> 00:27:52.400
<v Christopher Ariza>Yeah.

00:27:52.510 --> 00:27:56.900
<v Christopher Ariza>And this is, of course, the pattern that was set for migrating to Python 3,

00:27:57.000 --> 00:27:58.400
<v Christopher Ariza>the last sort of big,

00:27:58.870 --> 00:28:01.320
<v Christopher Ariza>heavy migration we had to go through.

00:28:01.780 --> 00:28:03.780
<v Christopher Ariza>And it's an effective way to help communicate.

00:28:03.980 --> 00:28:04.960
<v Christopher Ariza>But this number is very good.

00:28:05.140 --> 00:28:10.960
<v Christopher Ariza>I mean, 218 out of 360 critical packages supporting free threading already.

00:28:11.620 --> 00:28:13.800
<v Christopher Ariza>It's really a minority interest at this time is,

00:28:13.980 --> 00:28:14.540
<v Christopher Ariza>I think, really great.

00:28:15.080 --> 00:28:16.100
<v Michael Kennedy>I totally agree.

00:28:16.940 --> 00:28:20.860
<v Michael Kennedy>And I definitely get the feel that there's a lot of data science here.

00:28:21.200 --> 00:28:25.259
<v Michael Kennedy>I feel like the data science folks have an extra motivation to make this work

00:28:25.280 --> 00:28:30.860
<v Michael Kennedy>because data science folks, way more than web and sort of DevOps-y and whatever other people are

00:28:31.000 --> 00:28:34.020
<v Michael Kennedy>doing, there's not as much computational need in the same way,

00:28:34.360 --> 00:28:35.840
<v Michael Kennedy>you know, but if you got a billion

00:28:36.080 --> 00:28:37.580
<v Michael Kennedy>rows and you want to jam on them,

00:28:37.880 --> 00:28:40.580
<v Michael Kennedy>all of a sudden you're like, why do I have 20 processors and I'm

00:28:40.700 --> 00:28:41.100
<v Michael Kennedy>using one?

00:28:41.300 --> 00:28:41.580
<v Christopher Ariza>Yeah.

00:28:41.920 --> 00:28:47.280
<v Christopher Ariza>I mean, your escape hatch has been try to run it on a GPU or try to do

00:28:47.440 --> 00:28:49.540
<v Christopher Ariza>multi-processing or try to implement it in C,

00:28:49.980 --> 00:28:52.999
<v Christopher Ariza>but implementing your own homegrown multi-threaded

00:28:53.020 --> 00:28:54.920
<v Christopher Ariza>code in C or C++ isn't great.

00:28:55.170 --> 00:28:56.020
<v Christopher Ariza>You can use Rust.

00:28:56.260 --> 00:28:58.540
<v Christopher Ariza>Rust's multi-threaded support is fantastic.

00:28:58.710 --> 00:28:58.840
<v Christopher Ariza>And

00:28:58.940 --> 00:29:03.320
<v Christopher Ariza>of course, we've seen a ton of Python C extension or rather extensions written in Rust,

00:29:03.700 --> 00:29:04.520
<v Christopher Ariza>where the

00:29:04.680 --> 00:29:06.240
<v Christopher Ariza>threading story is excellent.

00:29:07.170 --> 00:29:09.140
<v Christopher Ariza>And we can get performance there.

00:29:09.460 --> 00:29:11.340
<v Christopher Ariza>But to have it in the language,

00:29:12.000 --> 00:29:15.820
<v Christopher Ariza>there are places where we have to deal with heavy Python objects and being able to do

00:29:16.190 --> 00:29:20.360
<v Christopher Ariza>big stuff with them concurrently with lightweight threads is just a huge change.

00:29:20.520 --> 00:29:21.540
<v Michael Kennedy>It is a huge change.

00:29:21.740 --> 00:29:31.600
<v Michael Kennedy>I'm a little nervous about all of this stuff. I don't know. Not because I used to do a lot of C++ and a lot of C# and scientific computing and visualization type stuff.

00:29:31.800 --> 00:29:33.700
<v Michael Kennedy>And in the early days of my work,

00:29:33.900 --> 00:29:39.660
<v Michael Kennedy>we did all kinds of threading and so on to get advantage of all the computation we can do, you know,

00:29:39.840 --> 00:29:40.800
<v Michael Kennedy>in those worlds,

00:29:41.080 --> 00:29:42.580
<v Michael Kennedy>you think about pointers,

00:29:43.140 --> 00:29:43.740
<v Michael Kennedy>shared data,

00:29:44.380 --> 00:29:44.880
<v Michael Kennedy>allocations,

00:29:45.580 --> 00:29:46.100
<v Michael Kennedy>race conditions,

00:29:46.420 --> 00:29:49.340
<v Michael Kennedy>deadlocks, like they're just always something that's kind of like, well,

00:29:49.600 --> 00:29:50.400
<v Michael Kennedy>as I'm thinking through

00:29:50.420 --> 00:29:54.240
<v Michael Kennedy>architecture or how this works or if it's correct check check you like they're going through your

00:29:54.480 --> 00:29:58.800
<v Michael Kennedy>mind i don't think that's happened traditionally in the python space and i talk to people i don't

00:29:58.980 --> 00:30:03.000
<v Michael Kennedy>hear them going oh and we're using the re-entered lock here because of this and then we have a

00:30:03.260 --> 00:30:09.640
<v Michael Kennedy>semaphore so that we don't overwhelm like that just isn't there and so builds and ci passes for

00:30:09.810 --> 00:30:15.520
<v Michael Kennedy>free threading and actually is free of threading bugs or race conditions or deadlocks those are two

00:30:15.680 --> 00:30:19.640
<v Michael Kennedy>different things and so yeah yeah that's i don't know how you feel about that what do you think

00:30:19.660 --> 00:30:24.180
<v Christopher Ariza>use immutable data structures and don't try to mutate things in place while you're doing your

00:30:24.270 --> 00:30:29.960
<v Christopher Ariza>multi-threading and you solve a huge number you just avoid a ton of the problems and i think that's

00:30:30.200 --> 00:30:37.800
<v Christopher Ariza>that's i think that's true if you can if you can avoid doing in-place mutation while doing your

00:30:37.850 --> 00:30:42.700
<v Christopher Ariza>multi-threading it just removes a ton of the challenges that all of those different types of

00:30:42.800 --> 00:30:48.140
<v Christopher Ariza>locks that you mentioned are there to handle i think it's pretty rare that you really need to

00:30:48.100 --> 00:30:48.880
<v Christopher Ariza>get into that.

00:30:49.860 --> 00:30:50.500
<v Christopher Ariza>But again,

00:30:50.660 --> 00:30:54.020
<v Christopher Ariza>what's fascinating is that Python has had all of the resources necessary

00:30:54.140 --> 00:31:00.280
<v Christopher Ariza>to handle locking as needed for multi-threaded code for a decade,

00:31:00.580 --> 00:31:00.720
<v Christopher Ariza>probably.

00:31:01.160 --> 00:31:02.200
<v Christopher Ariza>It already has,

00:31:02.300 --> 00:31:04.940
<v Christopher Ariza>all the tools are there. So if you do get in a complicated situation,

00:31:05.700 --> 00:31:06.520
<v Christopher Ariza>the tools are already

00:31:06.720 --> 00:31:07.900
<v Christopher Ariza>there in the standard library.

00:31:08.340 --> 00:31:11.000
<v Christopher Ariza>But I think the other thing you bring up that is quite relevant

00:31:11.020 --> 00:31:19.040
<v Christopher Ariza>is the testing regime of making sure that our CI is actually getting at the multi-threaded

00:31:19.240 --> 00:31:21.140
<v Christopher Ariza>scenarios that we need to exercise.

00:31:21.980 --> 00:31:24.480
<v Christopher Ariza>And that's something that I think you're right. A lot of

00:31:24.830 --> 00:31:30.820
<v Christopher Ariza>Python projects haven't had that in their sort of CI battery of testing.

00:31:31.180 --> 00:31:31.280
<v Michael Kennedy>Yeah.

00:31:31.660 --> 00:31:33.000
<v Michael Kennedy>I think that agents,

00:31:33.310 --> 00:31:38.160
<v Michael Kennedy>the AI agents actually could help a lot. I want a barrage of stress tests

00:31:38.160 --> 00:31:40.440
<v Michael Kennedy>for this thing using parallelism.

00:31:40.490 --> 00:31:42.900
<v Michael Kennedy>And we all have many, many core machines these days,

00:31:43.300 --> 00:31:43.400
<v Michael Kennedy>right?

00:31:43.580 --> 00:31:44.720
<v Michael Kennedy>So you could do it.

00:31:44.870 --> 00:31:45.360
<v Michael Kennedy>You could do it.

00:31:45.400 --> 00:31:45.980
<v Christopher Ariza>Yeah, absolutely.

00:31:46.540 --> 00:31:46.700
<v Christopher Ariza>Absolutely.

00:31:47.360 --> 00:31:47.720
<v Michael Kennedy>I just,

00:31:47.920 --> 00:31:49.160
<v Michael Kennedy>so I wanted to adopt this.

00:31:49.160 --> 00:31:51.000
<v Michael Kennedy>I'm like, oh, let me try for one of my websites

00:31:52.120 --> 00:31:53.000
<v Michael Kennedy>because that would be really cool,

00:31:53.220 --> 00:31:53.300
<v Michael Kennedy>right?

00:31:53.380 --> 00:31:55.280
<v Michael Kennedy>Is if I could somehow just say,

00:31:55.660 --> 00:31:56.860
<v Michael Kennedy>we're going to turn on multi-threading

00:31:57.500 --> 00:31:59.120
<v Michael Kennedy>and server as eight cores.

00:31:59.360 --> 00:32:00.500
<v Michael Kennedy>So we're just going to have eight threads.

00:32:00.640 --> 00:32:03.100
<v Michael Kennedy>I mean, that gives me like eight X amount of processing

00:32:03.230 --> 00:32:05.460
<v Michael Kennedy>on the CPU side without,

00:32:05.620 --> 00:32:06.200
<v Michael Kennedy>you know,

00:32:06.340 --> 00:32:10.340
<v Michael Kennedy>farming that out to other workers and raising the RAM. Like this is a big part of my talk,

00:32:10.530 --> 00:32:10.640
<v Michael Kennedy>actually,

00:32:10.800 --> 00:32:11.160
<v Michael Kennedy>at 5A.

00:32:11.560 --> 00:32:14.220
<v Michael Kennedy>But the free threading would make a huge bonus,

00:32:14.450 --> 00:32:15.840
<v Michael Kennedy>a huge benefit to that,

00:32:15.890 --> 00:32:16.300
<v Michael Kennedy>I think.

00:32:16.500 --> 00:32:24.580
<v Michael Kennedy>But then while we were talking, I just ran a little WC-L and I have 270 plus packages

00:32:25.470 --> 00:32:26.680
<v Michael Kennedy>in my virtual environment.

00:32:27.740 --> 00:32:32.160
<v Michael Kennedy>Now, some of those are like porting stuff for just the developer mode.

00:32:32.180 --> 00:32:34.040
<v Michael Kennedy>So let's call it 150.

00:32:34.780 --> 00:32:37.460
<v Michael Kennedy>What's the chances all 150 are green on this list?

00:32:37.770 --> 00:32:40.140
<v Michael Kennedy>I will bet you strongly that it's zero.

00:32:40.520 --> 00:32:41.660
<v Michael Kennedy>They don't all have to be, right?

00:32:41.800 --> 00:32:45.800
<v Michael Kennedy>Like the thing that does markdown parsing is probably only parsing a single.

00:32:46.120 --> 00:32:51.120
<v Michael Kennedy>You know, like it doesn't necessarily mean that I have to have all 150 checked off,

00:32:51.420 --> 00:32:53.740
<v Michael Kennedy>but it's got a little bit of a two to three feel,

00:32:54.120 --> 00:32:54.260
<v Michael Kennedy>fortunately.

00:32:54.420 --> 00:32:57.620
<v Michael Kennedy>Like if you've got one thing that doesn't cross over,

00:32:57.790 --> 00:33:00.160
<v Michael Kennedy>are you able to still make that move?

00:33:00.460 --> 00:33:01.760
<v Michael Kennedy>I mean, you could do the lock again.

00:33:01.920 --> 00:33:06.540
<v Michael Kennedy>Like, OK, we're just going to force single thread it onto this part of my code if it's really, really important.

00:33:06.800 --> 00:33:07.480
<v Michael Kennedy>But what do you think?

00:33:07.960 --> 00:33:12.880
<v Christopher Ariza>Well, so what you're pointing out is the challenge of thread safety when we have to resort to a lock.

00:33:13.100 --> 00:33:18.540
<v Christopher Ariza>But the other thing that we need to keep in mind, and this is sort of the peculiar situation we're in at this time,

00:33:19.080 --> 00:33:20.840
<v Christopher Ariza>is that if you first of all,

00:33:21.100 --> 00:33:24.040
<v Christopher Ariza>if you have a package that is native Python,

00:33:24.420 --> 00:33:25.060
<v Christopher Ariza>there's no concern.

00:33:25.500 --> 00:33:28.260
<v Christopher Ariza>native Python packages will load in free-threaded Python,

00:33:28.860 --> 00:33:30.160
<v Christopher Ariza>though they may not be thread safe.

00:33:30.760 --> 00:33:33.920
<v Christopher Ariza>But they will load and the gil will remain disabled.

00:33:34.240 --> 00:33:36.940
<v Christopher Ariza>The real issue that people have to be aware of,

00:33:36.940 --> 00:33:39.280
<v Christopher Ariza>and I think the issue that's a challenge for adoption,

00:33:39.760 --> 00:33:43.580
<v Christopher Ariza>is that if you load a package that is a binary,

00:33:44.060 --> 00:33:46.480
<v Christopher Ariza>that has not opted into free-threaded Python,

00:33:47.140 --> 00:33:48.500
<v Christopher Ariza>like PsychoPG as I show,

00:33:49.880 --> 00:33:52.780
<v Michael Kennedy>The most popular Postgres database adapter for Python

00:33:53.200 --> 00:33:54.580
<v Michael Kennedy>for the most popular database.

00:33:56.260 --> 00:34:02.200
<v Christopher Ariza>yeah so if you load any wheel that is not compiled for three-threaded python it will

00:34:02.420 --> 00:34:09.240
<v Christopher Ariza>re-enable the GIL and that's a particularly troubling thing so to say it as i say in my slides

00:34:09.300 --> 00:34:16.679
<v Christopher Ariza>the GIL is a zombie right now in the free-threaded binary of python the GIL is not removed it is

00:34:17.040 --> 00:34:23.060
<v Christopher Ariza>disabled and we can turn it back on at the start of the python free-threaded python we can it can

00:34:22.940 --> 00:34:26.060
<v Christopher Ariza>also get enabled because you import a wheel.

00:34:26.429 --> 00:34:27.659
<v Christopher Ariza>So that's not compatible.

00:34:27.870 --> 00:34:29.179
<v Christopher Ariza>So what that means is any

00:34:29.379 --> 00:34:30.720
<v Christopher Ariza>time in the life of your program,

00:34:31.169 --> 00:34:35.040
<v Christopher Ariza>if you happen to have a process that or a function that has an

00:34:35.200 --> 00:34:37.260
<v Christopher Ariza>internal import, or you finally call on some routine,

00:34:37.860 --> 00:34:40.500
<v Christopher Ariza>it's going to re-enable the GIL dynamically

00:34:40.850 --> 00:34:41.419
<v Christopher Ariza>in a moment.

00:34:41.570 --> 00:34:47.379
<v Christopher Ariza>And so if you had been counting on free threaded performance and the GIL then gets

00:34:47.540 --> 00:34:47.800
<v Christopher Ariza>enabled,

00:34:48.340 --> 00:34:52.220
<v Christopher Ariza>your free threaded performance is going to go away and potentially your performance is

00:34:52.220 --> 00:34:57.600
<v Christopher Ariza>going to get much worse so i think that's the real check independent of getting uh you know thread

00:34:57.840 --> 00:35:03.360
<v Christopher Ariza>safety that's another challenge but just having the basic compatibility in the wheels is critical

00:35:03.920 --> 00:35:09.860
<v Christopher Ariza>to ensuring that your process remains without the gale for its full run yeah and i'm looking for

00:35:10.020 --> 00:35:14.640
<v Michael Kennedy>where the common is in your slides but somewhere you actually show the message so if you import

00:35:15.100 --> 00:35:22.180
<v Michael Kennedy>psycho pg which one was it psycho pg2 or whatever it was yeah i think it's then yeah then you get a

00:35:22.200 --> 00:35:22.680
<v Michael Kennedy>a warning,

00:35:22.860 --> 00:35:23.300
<v Michael Kennedy>not an error,

00:35:23.580 --> 00:35:23.960
<v Michael Kennedy>just a warning.

00:35:24.460 --> 00:35:26.760
<v Michael Kennedy>Well, we're not ready for a free threaded Python. So

00:35:26.800 --> 00:35:29.060
<v Michael Kennedy>we've turned it off for the process for everything.

00:35:29.420 --> 00:35:30.260
<v Michael Kennedy>You're like, wait, what?

00:35:31.900 --> 00:35:33.080
<v Michael Kennedy>You can just turn it off.

00:35:33.460 --> 00:35:35.180
<v Michael Kennedy>No, no, no, no. Don't just turn it off. Like

00:35:36.480 --> 00:35:37.480
<v Michael Kennedy>that's super subtle,

00:35:37.700 --> 00:35:37.840
<v Michael Kennedy>right?

00:35:38.080 --> 00:35:38.360
<v Christopher Ariza>Yeah.

00:35:38.940 --> 00:35:39.000
<v Christopher Ariza>Yeah.

00:35:39.160 --> 00:35:41.560
<v Christopher Ariza>And so like people opting into people who were using

00:35:41.660 --> 00:35:46.839
<v Christopher Ariza>free threading are probably using it for the performance and it's the stakes are high because

00:35:46.860 --> 00:35:54.360
<v Christopher Ariza>if the same free threaded code on standard python will in many cases go slower and sometimes a lot

00:35:54.620 --> 00:36:00.660
<v Christopher Ariza>slower whereas with free threaded python it can go half the speed or an order of magnitude faster

00:36:01.080 --> 00:36:07.500
<v Christopher Ariza>that's night and day and so you are so right now writing libraries or writing routines processes

00:36:07.630 --> 00:36:13.800
<v Christopher Ariza>to depend on free threaded python is great but you have to be super careful that uh you don't

00:36:13.820 --> 00:36:19.280
<v Christopher Ariza>incidentally import something that re-enables the GIL and you wonder why now things are taking you

00:36:19.280 --> 00:36:25.980
<v Michael Kennedy>know 10 times as fast as a lot and it's using not one core but all the cores and more memory you're

00:36:25.980 --> 00:36:31.920
<v Michael Kennedy>like wait it's using it more my compute or my server or whatever and it's slower this is going

00:36:32.040 --> 00:36:36.400
<v Michael Kennedy>slower i'm here for yeah yeah yeah that's right that's right i found it so your slide the title

00:36:36.580 --> 00:36:42.540
<v Michael Kennedy>raising the dead yeah yeah so you can actually ask the system is the GIL enabled right yeah so it's

00:36:42.520 --> 00:36:43.940
<v Christopher Ariza>So it's a private method,

00:36:44.160 --> 00:36:45.900
<v Christopher Ariza>I guess, because it's still experimental.

00:36:46.120 --> 00:36:48.560
<v Christopher Ariza>It's a leading underscore is gil enabled,

00:36:48.780 --> 00:36:51.500
<v Christopher Ariza>but that is your runtime check to see if the

00:36:51.640 --> 00:36:52.280
<v Christopher Ariza>gil is enabled.

00:36:52.620 --> 00:36:57.240
<v Christopher Ariza>Now, I think what I'm not quite certain about, so it does give a warning, but I think what

00:36:57.240 --> 00:37:04.960
<v Christopher Ariza>it says is that if you start free threaded Python with the flag of the gil always disabled,

00:37:05.250 --> 00:37:07.700
<v Christopher Ariza>it might err instead of giving you a warning.

00:37:07.830 --> 00:37:09.440
<v Christopher Ariza>I haven't experimented with that yet.

00:37:09.620 --> 00:37:14.240
<v Christopher Ariza>So there might be a way to lock it down and say, if anything tries to re-enable the gil,

00:37:14.800 --> 00:37:14.900
<v Christopher Ariza>fail,

00:37:15.080 --> 00:37:16.880
<v Christopher Ariza>which is kind of the default I would prefer.

00:37:17.240 --> 00:37:17.660
<v Michael Kennedy>Yes.

00:37:17.820 --> 00:37:18.420
<v Michael Kennedy>But actually,

00:37:18.620 --> 00:37:20.360
<v Michael Kennedy>I think it's YOLO.

00:37:20.860 --> 00:37:22.100
<v Michael Kennedy>Let me read the message.

00:37:22.360 --> 00:37:23.640
<v Michael Kennedy>So here's the code.

00:37:23.940 --> 00:37:24.740
<v Michael Kennedy>Run free-threaded Python.

00:37:25.220 --> 00:37:25.680
<v Michael Kennedy>Import this.

00:37:25.920 --> 00:37:26.480
<v Michael Kennedy>Is gil-enabled?

00:37:26.580 --> 00:37:26.820
<v Michael Kennedy>No.

00:37:27.080 --> 00:37:28.480
<v Michael Kennedy>Import Psycho PG2.

00:37:28.840 --> 00:37:29.840
<v Michael Kennedy>Big message I'm about to read.

00:37:30.080 --> 00:37:30.720
<v Michael Kennedy>Is gil-enabled?

00:37:31.080 --> 00:37:31.240
<v Michael Kennedy>Yes.

00:37:31.600 --> 00:37:31.720
<v Michael Kennedy>Right?

00:37:31.800 --> 00:37:33.020
<v Michael Kennedy>So it's turned it back on,

00:37:33.260 --> 00:37:36.740
<v Michael Kennedy>which is just the fact that that can happen at all is very weird

00:37:36.760 --> 00:37:37.000
<v Michael Kennedy>to me.

00:37:37.280 --> 00:37:37.400
<v Christopher Ariza>Yeah.

00:37:37.520 --> 00:37:38.420
<v Michael Kennedy>But OK, here's the message.

00:37:38.840 --> 00:37:39.240
<v Michael Kennedy>491.

00:37:39.520 --> 00:37:40.460
<v Michael Kennedy>runtime warning,

00:37:40.880 --> 00:37:41.180
<v Michael Kennedy>not error,

00:37:41.560 --> 00:37:43.740
<v Michael Kennedy>the global interpreter lock gil has been applied,

00:37:44.180 --> 00:37:45.660
<v Michael Kennedy>has been enabled to load the module

00:37:45.780 --> 00:37:48.040
<v Michael Kennedy>psychoPG2.underscorePsychoPG,

00:37:48.520 --> 00:37:50.960
<v Michael Kennedy>which has not declared that it can run safely

00:37:51.210 --> 00:37:51.740
<v Michael Kennedy>without the gil.

00:37:52.120 --> 00:37:53.460
<v Michael Kennedy>And here's why I think it's YOLO.

00:37:53.780 --> 00:37:54.820
<v Michael Kennedy>To override this behavior

00:37:55.220 --> 00:37:57.700
<v Michael Kennedy>and keep the gil disabled at your own risk,

00:37:58.820 --> 00:38:01.980
<v Michael Kennedy>run with Python underscore gil equals zero.

00:38:02.500 --> 00:38:02.720
<v Christopher Ariza>Yeah.

00:38:03.090 --> 00:38:03.480
<v Michael Kennedy>And the environment.

00:38:03.940 --> 00:38:05.220
<v Michael Kennedy>So because the at your own risk,

00:38:05.370 --> 00:38:06.420
<v Michael Kennedy>rather than it's going to stop,

00:38:06.620 --> 00:38:07.300
<v Michael Kennedy>it's going to be like Right,

00:38:07.320 --> 00:38:08.360
<v Christopher Ariza>right, you're right. Let's

00:38:08.360 --> 00:38:08.460
<v Michael Kennedy>roll,

00:38:08.620 --> 00:38:08.700
<v Michael Kennedy>baby.

00:38:08.940 --> 00:38:09.040
<v Michael Kennedy>Let's

00:38:09.040 --> 00:38:09.200
<v Michael Kennedy>roll.

00:38:09.520 --> 00:38:11.300
<v Christopher Ariza>Yeah, so that will ignore compatibility,

00:38:11.800 --> 00:38:15.300
<v Christopher Ariza>but it's not making any claim for thread safety.

00:38:15.660 --> 00:38:16.820
<v Christopher Ariza>I think that's what's doing.

00:38:16.960 --> 00:38:19.320
<v Christopher Ariza>At least the gil won't be dynamically re-enabled,

00:38:19.560 --> 00:38:23.200
<v Christopher Ariza>but what they're saying is you have no idea what's going to happen with this package.

00:38:23.220 --> 00:38:27.440
<v Michael Kennedy>Yeah, we've explicitly said that this is probably going to have a threading bug.

00:38:28.520 --> 00:38:29.000
<v Christopher Ariza>So,

00:38:30.040 --> 00:38:30.400
<v Michael Kennedy>you know.

00:38:31.380 --> 00:38:31.580
<v Christopher Ariza>Yeah.

00:38:32.000 --> 00:38:32.460
<v Michael Kennedy>Then again,

00:38:32.760 --> 00:38:34.720
<v Michael Kennedy>these libraries are complicated.

00:38:35.120 --> 00:38:38.640
<v Michael Kennedy>There's often so much of them, and I think this kind of drives me crazy.

00:38:38.700 --> 00:38:40.200
<v Michael Kennedy>We're not as bad as the JavaScript people.

00:38:40.600 --> 00:38:41.940
<v Michael Kennedy>Let's just feel a little better about yourself.

00:38:42.240 --> 00:38:43.460
<v Michael Kennedy>Look in that direction.

00:38:43.980 --> 00:38:44.140
<v Michael Kennedy>However,

00:38:44.840 --> 00:38:48.140
<v Michael Kennedy>why do I have 270 packages in my web app?

00:38:48.320 --> 00:38:49.060
<v Michael Kennedy>Like that is ridiculous.

00:38:49.560 --> 00:38:50.860
<v Michael Kennedy>I'll bet you there's a bunch of them

00:38:51.140 --> 00:38:53.600
<v Michael Kennedy>that I'm using some package and it said,

00:38:53.940 --> 00:38:57.520
<v Michael Kennedy>oh, I need like some random small little piece

00:38:57.740 --> 00:39:00.460
<v Michael Kennedy>that this other much more complicated library offers.

00:39:01.000 --> 00:39:02.360
<v Michael Kennedy>I'm going to add that random,

00:39:02.800 --> 00:39:03.240
<v Michael Kennedy>that library

00:39:03.360 --> 00:39:04.760
<v Michael Kennedy>so I can have that random small piece.

00:39:04.800 --> 00:39:07.040
<v Michael Kennedy>I think there should be a lot more vendoring in

00:39:07.040 --> 00:39:07.580
<v Michael Kennedy>or just,

00:39:07.930 --> 00:39:08.020
<v Michael Kennedy>hey,

00:39:08.200 --> 00:39:10.540
<v Michael Kennedy>Claude, I need to resolve a DNS.

00:39:11.130 --> 00:39:13.700
<v Michael Kennedy>Can you just write me the code to give me the,

00:39:14.260 --> 00:39:15.780
<v Michael Kennedy>given a DNS name,

00:39:16.100 --> 00:39:16.780
<v Michael Kennedy>give me the IP address

00:39:17.350 --> 00:39:19.120
<v Michael Kennedy>instead of depending on a DNS library

00:39:19.260 --> 00:39:20.740
<v Michael Kennedy>that depends on four other things?

00:39:21.020 --> 00:39:21.340
<v Michael Kennedy>You know what I mean?

00:39:21.819 --> 00:39:23.660
<v Michael Kennedy>That's probably 20 lines of code

00:39:23.730 --> 00:39:24.520
<v Michael Kennedy>that I don't have to write.

00:39:24.810 --> 00:39:26.620
<v Michael Kennedy>And we could have this dependency story

00:39:26.710 --> 00:39:29.180
<v Michael Kennedy>down to 20 or something instead of 200.

00:39:29.660 --> 00:39:29.860
<v Christopher Ariza>Yeah.

00:39:30.180 --> 00:39:31.220
<v Michael Kennedy>And that makes it much easier.

00:39:31.620 --> 00:39:32.060
<v Michael Kennedy>I don't know.

00:39:32.120 --> 00:39:33.180
<v Michael Kennedy>I don't know how to solve this problem,

00:39:33.210 --> 00:39:34.460
<v Michael Kennedy>but that's the place we're in.

00:39:34.620 --> 00:39:34.780
<v Christopher Ariza>Yeah,

00:39:35.000 --> 00:39:38.420
<v Christopher Ariza>I definitely feel that pull as well in my own work where,

00:39:39.220 --> 00:39:46.160
<v Christopher Ariza>you know, I can look for a small library to do something or I can have my agent just write it and have it be,

00:39:46.580 --> 00:39:46.820
<v Christopher Ariza>you know,

00:39:47.420 --> 00:39:49.760
<v Christopher Ariza>95% or 100% of what I need.

00:39:50.780 --> 00:39:53.660
<v Christopher Ariza>So we don't get as much reuse through that mechanism,

00:39:54.340 --> 00:39:56.780
<v Christopher Ariza>but it does avoid a lot of dependency problems.

00:39:57.240 --> 00:39:57.380
<v Michael Kennedy>Yeah,

00:39:57.540 --> 00:40:03.120
<v Michael Kennedy>it avoids this threading issue if the third level transit of dependency is not thread ready yet.

00:40:03.440 --> 00:40:07.160
<v Michael Kennedy>You could tell your agent, make these 20 lines of code thread safe,

00:40:07.620 --> 00:40:12.300
<v Michael Kennedy>but it's really hard to tell it to make like all of these dependencies you don't control behave in a way, you know?

00:40:12.550 --> 00:40:12.680
<v Christopher Ariza>Yeah,

00:40:12.860 --> 00:40:13.000
<v Christopher Ariza>that's right.

00:40:13.000 --> 00:40:17.240
<v Michael Kennedy>The other one that is honestly a 2026 top hit as well.

00:40:17.420 --> 00:40:18.480
<v Michael Kennedy>Not as much as AI,

00:40:18.820 --> 00:40:21.320
<v Michael Kennedy>but supply chain attacks and vulnerabilities.

00:40:21.860 --> 00:40:25.500
<v Michael Kennedy>And you know what you don't get if you have a static file that has got 20 lines of Python you wrote in?

00:40:26.040 --> 00:40:27.160
<v Michael Kennedy>Supply chain exposure.

00:40:27.520 --> 00:40:28.500
<v Michael Kennedy>Not on that file anyway.

00:40:28.570 --> 00:40:28.960
<v Michael Kennedy>You know what I mean?

00:40:30.140 --> 00:40:30.320
<v Christopher Ariza>Yeah,

00:40:30.500 --> 00:40:31.000
<v Christopher Ariza>that's true too.

00:40:31.130 --> 00:40:32.900
<v Christopher Ariza>I mean, that's absolutely the case.

00:40:33.480 --> 00:40:37.500
<v Christopher Ariza>there is a benefit from reducing your dependency exposure

00:40:38.280 --> 00:40:40.880
<v Christopher Ariza>for not only supporting new features like this,

00:40:41.060 --> 00:40:42.420
<v Christopher Ariza>but also for security.

00:40:42.830 --> 00:40:42.940
<v Christopher Ariza>Absolutely.

00:40:43.480 --> 00:40:43.900
<v Michael Kennedy>You work,

00:40:44.340 --> 00:40:44.900
<v Michael Kennedy>at least for a while,

00:40:45.320 --> 00:40:46.860
<v Michael Kennedy>in a very high stakes industry.

00:40:47.320 --> 00:40:48.880
<v Michael Kennedy>What have you all been doing with dependencies

00:40:49.320 --> 00:40:50.640
<v Michael Kennedy>and supply chain concerns?

00:40:50.950 --> 00:40:51.060
<v Michael Kennedy>Like,

00:40:51.490 --> 00:40:53.420
<v Michael Kennedy>has this been something that's concerned you as well?

00:40:54.120 --> 00:40:54.660
<v Christopher Ariza>Yeah, absolutely.

00:40:56.940 --> 00:40:58.000
<v Michael Kennedy>Keeps you up in light, right?

00:40:58.080 --> 00:40:58.660
<v Michael Kennedy>You're like, oh God.

00:40:58.920 --> 00:40:59.500
<v Christopher Ariza>Oh, yeah.

00:41:00.040 --> 00:41:06.520
<v Christopher Ariza>So when I took the role of CTO, I started getting really involved in cybersecurity.

00:41:07.020 --> 00:41:11.080
<v Christopher Ariza>And when I looked at the security platform my organization had,

00:41:11.280 --> 00:41:12.240
<v Christopher Ariza>I was quite impressed.

00:41:12.260 --> 00:41:14.240
<v Christopher Ariza>We had so many things covered.

00:41:14.800 --> 00:41:23.360
<v Christopher Ariza>But one aspect that was clearly not as secure as it could be was how we were managing Python dependencies,

00:41:23.540 --> 00:41:25.060
<v Christopher Ariza>which we were using Python heavily.

00:41:25.900 --> 00:41:31.300
<v Christopher Ariza>And we essentially let people download and install and try whatever they want,

00:41:31.460 --> 00:41:34.380
<v Christopher Ariza>which for a small org is very practical.

00:41:34.900 --> 00:41:37.280
<v Christopher Ariza>And developers like that freedom,

00:41:38.380 --> 00:41:40.960
<v Christopher Ariza>but there's tremendous risks with that approach.

00:41:42.010 --> 00:41:47.620
<v Christopher Ariza>Big organizations will turn to things like JFrog Artifactory or AWS.

00:41:47.990 --> 00:41:50.000
<v Christopher Ariza>I forget their tool of the same name.

00:41:51.320 --> 00:41:52.060
<v Christopher Ariza>It was, of course,

00:41:52.260 --> 00:41:57.340
<v Christopher Ariza>the JFrog artifactory that the rogue OpenAI agents hacked

00:41:57.780 --> 00:42:01.600
<v Christopher Ariza>to enable them to communicate and escape their sandbox.

00:42:03.360 --> 00:42:07.720
<v Michael Kennedy>Yeah, that was a hugging face incident that they basically hacked artifactory,

00:42:07.770 --> 00:42:11.860
<v Michael Kennedy>but not to do anything nefarious, but to use it as a command and control

00:42:12.260 --> 00:42:15.580
<v Michael Kennedy>and conversational back channel so they could get out.

00:42:15.580 --> 00:42:16.260
<v Michael Kennedy>It was so weird.

00:42:16.680 --> 00:42:17.180
<v Christopher Ariza>Yeah, absolutely.

00:42:17.980 --> 00:42:19.740
<v Christopher Ariza>So and then the thing that bothers me, though, is,

00:42:20.040 --> 00:42:20.380
<v Christopher Ariza>you know, people,

00:42:21.020 --> 00:42:25.020
<v Christopher Ariza>unless you have unless users in your organizations have completely locked down systems,

00:42:25.600 --> 00:42:30.760
<v Christopher Ariza>even if you set up an alternate pip or an artifactory on your in your network,

00:42:31.300 --> 00:42:33.380
<v Christopher Ariza>if someone takes their laptop to another network,

00:42:33.780 --> 00:42:38.760
<v Christopher Ariza>they can just go to pip or they can just download the package through another side channel and bring it in.

00:42:38.820 --> 00:42:53.600
<v Christopher Ariza>So what I found was that in my view, there seemed to be no really foolproof way to control what packages end up on your system without going to an extremely draconian level of controls on user level systems.

00:42:53.760 --> 00:42:57.320
<v Christopher Ariza>And that level of control wasn't where my org was ready to go.

00:42:57.800 --> 00:43:00.900
<v Christopher Ariza>So that was a big part of why I created this tool called Fetter,

00:43:01.080 --> 00:43:09.320
<v Christopher Ariza>which is a Rust-implemented local scanner that can find all of the Pythons, all of the Pythons on your system,

00:43:09.620 --> 00:43:13.420
<v Christopher Ariza>all of the site packages directories in every single place,

00:43:13.880 --> 00:43:20.240
<v Christopher Ariza>and give you a list of all of the packages that have CVEs and rank them and do a bunch of fun stuff with that.

00:43:20.300 --> 00:43:23.560
<v Christopher Ariza>So that was kind of my exploration of how to solve that problem.

00:43:24.120 --> 00:43:25.020
<v Christopher Ariza>It's slow.

00:43:25.460 --> 00:43:30.180
<v Christopher Ariza>Someone may have downloaded a package and Fedder is not going to notice until it does a scan.

00:43:30.660 --> 00:43:36.040
<v Christopher Ariza>But when I see a report about a Python package that has been compromised or whatever,

00:43:36.260 --> 00:43:36.660
<v Christopher Ariza>I can

00:43:36.660 --> 00:43:41.560
<v Christopher Ariza>do one little search and find out if anyone in my organization has that package.

00:43:41.860 --> 00:43:43.820
<v Christopher Ariza>And that's at least better than not knowing.

00:43:44.060 --> 00:43:45.040
<v Michael Kennedy>Yeah, it definitely is.

00:43:45.260 --> 00:43:45.660
<v Michael Kennedy>I don't know.

00:43:45.980 --> 00:43:50.260
<v Michael Kennedy>It's a very challenging problem because some of the magic of these modern programming languages

00:43:50.260 --> 00:43:53.760
<v Michael Kennedy>is some incredible feature is just install

00:43:54.000 --> 00:43:55.160
<v Michael Kennedy>or uv pip install away,

00:43:55.640 --> 00:43:55.760
<v Michael Kennedy>right?

00:43:55.920 --> 00:43:56.280
<v Michael Kennedy>I mean,

00:43:56.460 --> 00:43:58.360
<v Michael Kennedy>we've got the import anti-gravity,

00:43:58.540 --> 00:43:58.660
<v Michael Kennedy>right?

00:43:59.200 --> 00:43:59.400
<v Christopher Ariza>Yeah.

00:44:00.720 --> 00:44:03.160
<v Michael Kennedy>That's literally was basically what it was about

00:44:03.360 --> 00:44:04.080
<v Michael Kennedy>was the XKCD.

00:44:04.280 --> 00:44:05.600
<v Michael Kennedy>And by the way, if you don't know this,

00:44:05.760 --> 00:44:07.460
<v Michael Kennedy>type import anti-gravity into your ripple.

00:44:07.700 --> 00:44:07.780
<v Michael Kennedy>But,

00:44:08.080 --> 00:44:09.720
<v Michael Kennedy>you know, it's like the old cartoon

00:44:09.980 --> 00:44:11.160
<v Michael Kennedy>is like there's someone up there flying.

00:44:11.280 --> 00:44:12.040
<v Michael Kennedy>How are you flying?

00:44:12.380 --> 00:44:12.480
<v Michael Kennedy>Python.

00:44:13.200 --> 00:44:14.300
<v Michael Kennedy>I learned it last night.

00:44:15.080 --> 00:44:16.200
<v Michael Kennedy>Just import this.

00:44:16.400 --> 00:44:17.980
<v Michael Kennedy>I just typed import anti-gravity.

00:44:18.060 --> 00:44:18.560
<v Michael Kennedy>Off it goes,

00:44:18.840 --> 00:44:18.920
<v Michael Kennedy>right?

00:44:19.000 --> 00:44:19.140
<v Michael Kennedy>Yeah.

00:44:20.460 --> 00:44:26.380
<v Michael Kennedy>so gotta be careful bashing on it too hard right but at the same time it can get too i don't know

00:44:26.400 --> 00:44:30.660
<v Michael Kennedy>it can be it can be a bit too much yeah we'll get back to free 30 but i just one more thought is i

00:44:30.800 --> 00:44:37.680
<v Michael Kennedy>have you know i in the week most weeks with some extra ai credits not this week is today my credits

00:44:37.920 --> 00:44:42.940
<v Michael Kennedy>reset and i've got three three percent left that i'm saving if i need them for something like but

00:44:43.100 --> 00:44:47.360
<v Michael Kennedy>in general i've got a you know i've got 30 40 percent of whatever i didn't use just hanging

00:44:47.380 --> 00:44:47.620
<v Michael Kennedy>around.

00:44:48.000 --> 00:44:51.840
<v Michael Kennedy>I've considered just going into like, okay, what packages do I use?

00:44:52.260 --> 00:44:52.980
<v Michael Kennedy>Let me just do

00:44:53.340 --> 00:44:55.580
<v Michael Kennedy>a deep analysis of the threading,

00:44:55.860 --> 00:44:59.320
<v Michael Kennedy>write a bunch of tests and find any bugs and kind of just try

00:44:59.320 --> 00:45:03.660
<v Michael Kennedy>to work my way one at a time through my dependencies until I can be all green on that.

00:45:03.780 --> 00:45:04.820
<v Michael Kennedy>Are we free threaded yet?

00:45:05.000 --> 00:45:05.380
<v Michael Kennedy>Checkbox.

00:45:06.260 --> 00:45:07.720
<v Michael Kennedy>Maybe I'll do that at some point. That'd be fun.

00:45:07.980 --> 00:45:08.520
<v Christopher Ariza>Well, I think the,

00:45:08.880 --> 00:45:13.200
<v Christopher Ariza>if the performance you're looking for is overwhelmingly in your web server,

00:45:13.600 --> 00:45:19.080
<v Christopher Ariza>I think that's the first place you need to look and see if the web server you're using,

00:45:19.520 --> 00:45:21.280
<v Christopher Ariza>what its thread story is.

00:45:21.700 --> 00:45:29.760
<v Christopher Ariza>And I would start off by kind of just building some isolated tests with that and see if you really get better performance.

00:45:30.560 --> 00:45:32.340
<v Christopher Ariza>I think that's a key question.

00:45:32.920 --> 00:45:33.680
<v Michael Kennedy>It is a key question.

00:45:33.920 --> 00:45:34.780
<v Michael Kennedy>I think it would.

00:45:35.000 --> 00:45:35.960
<v Michael Kennedy>I definitely think it would.

00:45:36.120 --> 00:45:38.420
<v Michael Kennedy>Right now I have it turned off because I don't think it's worth it.

00:45:38.780 --> 00:45:38.940
<v Michael Kennedy>However,

00:45:39.180 --> 00:45:41.060
<v Michael Kennedy>because all the operations are async,

00:45:41.220 --> 00:45:42.860
<v Michael Kennedy>so it's kind of in a sense thread.

00:45:43.140 --> 00:45:45.620
<v Michael Kennedy>But if I could, if I could turn on true threads,

00:45:45.900 --> 00:45:46.720
<v Michael Kennedy>I certainly would.

00:45:46.740 --> 00:45:47.380
<v Michael Kennedy>I certainly would.

00:45:47.540 --> 00:45:49.260
<v Christopher Ariza>I mean, we were all excited when our web servers,

00:45:49.520 --> 00:45:51.160
<v Christopher Ariza>our Python web servers got async.

00:45:51.240 --> 00:45:52.220
<v Christopher Ariza>We were like, this is fantastic.

00:45:52.500 --> 00:45:53.840
<v Christopher Ariza>And then that was like a whole project.

00:45:54.420 --> 00:45:55.200
<v Christopher Ariza>But all the while,

00:45:55.400 --> 00:45:55.440
<v Christopher Ariza>yes,

00:45:55.600 --> 00:45:56.640
<v Christopher Ariza>async can do a lot.

00:45:56.820 --> 00:45:59.320
<v Christopher Ariza>But if you have performant lightweight threads,

00:45:59.700 --> 00:46:00.320
<v Christopher Ariza>they can do more.

00:46:01.360 --> 00:46:01.520
<v Michael Kennedy>Yeah,

00:46:01.780 --> 00:46:02.000
<v Michael Kennedy>absolutely.

00:46:03.280 --> 00:46:06.360
<v Michael Kennedy>Let's see if I can find your slides again.

00:46:07.579 --> 00:46:08.080
<v Michael Kennedy>Here we go.

00:46:08.320 --> 00:46:08.840
<v Michael Kennedy>I don't know where I put it.

00:46:08.920 --> 00:46:09.300
<v Michael Kennedy>Oh, here they are.

00:46:09.500 --> 00:46:12.020
<v Michael Kennedy>Maybe you could talk us through some of the trade-offs.

00:46:12.140 --> 00:46:12.840
<v Michael Kennedy>Like what you found,

00:46:13.140 --> 00:46:17.260
<v Michael Kennedy>because you've got a bunch of graphs and sometimes this was better and sometimes it wasn't.

00:46:17.400 --> 00:46:18.860
<v Michael Kennedy>So maybe we can talk a bit about that.

00:46:18.880 --> 00:46:19.380
<v Michael Kennedy>What do you think?

00:46:19.740 --> 00:46:19.820
<v Christopher Ariza>Sure.

00:46:19.840 --> 00:46:19.960
<v Christopher Ariza>Yeah.

00:46:20.300 --> 00:46:20.980
<v Christopher Ariza>So the.

00:46:21.640 --> 00:46:23.500
<v Michael Kennedy>And then I want to talk about your thread pool magic.

00:46:24.000 --> 00:46:24.220
<v Christopher Ariza>Sure.

00:46:24.760 --> 00:46:24.960
<v Christopher Ariza>Yes.

00:46:25.840 --> 00:46:26.100
<v Christopher Ariza>So.

00:46:26.640 --> 00:46:27.020
<v Michael Kennedy>Keep loading.

00:46:27.340 --> 00:46:27.440
<v Christopher Ariza>Yeah.

00:46:27.680 --> 00:46:28.080
<v Christopher Ariza>So the.

00:46:28.980 --> 00:46:30.760
<v Christopher Ariza>In my work in data frame libraries,

00:46:31.020 --> 00:46:36.080
<v Christopher Ariza>I was constantly frustrated by people showing performance tests on an arbitrary frame.

00:46:36.640 --> 00:46:37.380
<v Christopher Ariza>And it's like, OK,

00:46:37.740 --> 00:46:39.560
<v Christopher Ariza>so you made it go faster here.

00:46:39.960 --> 00:46:44.620
<v Christopher Ariza>But what I found through systematic performance analysis is the shape of the frame.

00:46:45.020 --> 00:46:45.700
<v Christopher Ariza>Is it wide?

00:46:45.700 --> 00:46:46.240
<v Christopher Ariza>Is it tall?

00:46:46.240 --> 00:46:46.880
<v Christopher Ariza>Is it square?

00:46:47.320 --> 00:46:48.080
<v Christopher Ariza>Makes a big difference.

00:46:48.480 --> 00:46:50.040
<v Christopher Ariza>And for some operations, the types,

00:46:50.360 --> 00:46:50.940
<v Christopher Ariza>are they floats?

00:46:50.940 --> 00:46:51.500
<v Christopher Ariza>Are they integers?

00:46:51.700 --> 00:46:52.360
<v Christopher Ariza>Are they strings?

00:46:52.820 --> 00:46:54.660
<v Christopher Ariza>Will make a huge difference as well.

00:46:54.920 --> 00:46:57.140
<v Christopher Ariza>So that led me to adopt this kind of pattern.

00:46:57.440 --> 00:47:02.140
<v Christopher Ariza>Whenever I'm doing performance tests on tabular data,

00:47:02.600 --> 00:47:05.380
<v Christopher Ariza>I systematically vary the tables into

00:47:05.740 --> 00:47:06.620
<v Christopher Ariza>tall, square,

00:47:06.960 --> 00:47:07.920
<v Christopher Ariza>and wide groups.

00:47:09.240 --> 00:47:11.200
<v Christopher Ariza>And depending on the types of operations you're doing,

00:47:11.480 --> 00:47:13.720
<v Christopher Ariza>this can show a great diversity of performance.

00:47:14.240 --> 00:47:14.440
<v Christopher Ariza>Now,

00:47:14.680 --> 00:47:17.280
<v Christopher Ariza>for this study, I was doing one type of operation,

00:47:17.540 --> 00:47:19.660
<v Christopher Ariza>which is row-wise function application.

00:47:20.100 --> 00:47:25.000
<v Christopher Ariza>In a lot of financial data modeling,

00:47:25.260 --> 00:47:28.560
<v Christopher Ariza>this is a common paradigm where you have a bunch of data in a table,

00:47:29.120 --> 00:47:31.220
<v Christopher Ariza>and maybe those columns are characteristics,

00:47:31.720 --> 00:47:35.220
<v Christopher Ariza>and you go and you want to apply a function to every row in that table

00:47:35.220 --> 00:47:40.300
<v Christopher Ariza>to do something with those characteristics and derive a new column or a new data set or what

00:47:40.430 --> 00:47:44.760
<v Christopher Ariza>have you. So row-wise computation is something that comes up all the time.

00:47:45.450 --> 00:47:46.200
<v Christopher Ariza>And so the first

00:47:46.200 --> 00:47:53.960
<v Christopher Ariza>thing I looked at here was if I have a simple giant table of a NumPy two-dimensional array

00:47:54.340 --> 00:47:55.000
<v Christopher Ariza>of integers,

00:47:55.740 --> 00:47:58.440
<v Christopher Ariza>and I'm just calling sum on each row,

00:47:58.620 --> 00:48:02.400
<v Christopher Ariza>can I go faster by doing those row sums with

00:48:02.420 --> 00:48:03.320
<v Christopher Ariza>multiple threads.

00:48:03.860 --> 00:48:07.940
<v Christopher Ariza>And this here, if the table is tall... Are you talking summing multiple columns,

00:48:08.150 --> 00:48:11.820
<v Michael Kennedy>like summing purchase and discount or something like that? Just summing a row.

00:48:12.030 --> 00:48:12.820
<v Christopher Ariza>Just summing each

00:48:13.000 --> 00:48:13.360
<v Michael Kennedy>row. A single row, okay.

00:48:13.540 --> 00:48:14.400
<v Christopher Ariza>A single row, yeah.

00:48:14.580 --> 00:48:16.760
<v Christopher Ariza>And so if the table is tall,

00:48:17.220 --> 00:48:18.600
<v Christopher Ariza>those rows are relatively

00:48:18.960 --> 00:48:22.300
<v Christopher Ariza>short and there's many more rows. If the table is wide,

00:48:22.700 --> 00:48:25.299
<v Christopher Ariza>each of those rows is more work and there's

00:48:25.320 --> 00:48:26.360
<v Christopher Ariza>fewer of those rows.

00:48:26.720 --> 00:48:33.300
<v Christopher Ariza>So my first tests of working with some on a two-dimensional NumPy array of,

00:48:33.370 --> 00:48:35.600
<v Christopher Ariza>I think that's 100 million elements total,

00:48:35.860 --> 00:48:38.100
<v Christopher Ariza>shows that with the gill,

00:48:38.700 --> 00:48:39.800
<v Christopher Ariza>every application of threads

00:48:39.810 --> 00:48:40.460
<v Christopher Ariza>is worse.

00:48:41.130 --> 00:48:42.160
<v Christopher Ariza>And that's expected.

00:48:42.400 --> 00:48:43.640
<v Christopher Ariza>That's what we're used to in Python,

00:48:44.150 --> 00:48:45.820
<v Christopher Ariza>even though this is NumPy.

00:48:46.380 --> 00:48:47.320
<v Christopher Ariza>With the no gill,

00:48:47.610 --> 00:48:51.100
<v Christopher Ariza>I was able to show that for tall and square tables,

00:48:51.740 --> 00:48:52.800
<v Christopher Ariza>performance degraded.

00:48:54.680 --> 00:48:55.280
<v Christopher Ariza>But

00:48:55.300 --> 00:49:02.720
<v Christopher Ariza>actually able to get a reduction almost to maybe two thirds the performance just by using,

00:49:03.080 --> 00:49:08.020
<v Christopher Ariza>I think that was eight threads on summing the rows of an umpire array. And that was like one of the

00:49:08.180 --> 00:49:10.840
<v Christopher Ariza>first insights where I was like, I can't believe this is possible.

00:49:11.020 --> 00:49:12.700
<v Christopher Ariza>Even though the other cases don't

00:49:12.860 --> 00:49:13.260
<v Christopher Ariza>work out well,

00:49:13.780 --> 00:49:16.000
<v Christopher Ariza>having that one work was just a really positive sign.

00:49:16.160 --> 00:49:16.360
<v Michael Kennedy>Yeah,

00:49:16.600 --> 00:49:16.940
<v Michael Kennedy>that's awesome.

00:49:17.200 --> 00:49:17.260
<v Michael Kennedy>So

00:49:17.560 --> 00:49:18.660
<v Michael Kennedy>there are certain situations,

00:49:18.840 --> 00:49:20.360
<v Michael Kennedy>and this is kind of what I was hinting at before,

00:49:20.580 --> 00:49:21.119
<v Michael Kennedy>like if you don't

00:49:21.100 --> 00:49:21.720
<v Michael Kennedy>give it enough work,

00:49:21.880 --> 00:49:23.260
<v Michael Kennedy>it just doesn't pay off.

00:49:23.460 --> 00:49:28.000
<v Michael Kennedy>But your next example for even square sums or

00:49:28.120 --> 00:49:34.140
<v Michael Kennedy>something along those lines, basically doing more work per row than any form of wideness,

00:49:34.460 --> 00:49:35.100
<v Michael Kennedy>square or wider,

00:49:35.320 --> 00:49:37.160
<v Michael Kennedy>it would start to be really effective,

00:49:37.360 --> 00:49:37.440
<v Michael Kennedy>right?

00:49:37.660 --> 00:49:37.840
<v Christopher Ariza>Yeah,

00:49:38.020 --> 00:49:38.360
<v Christopher Ariza>that's right.

00:49:39.040 --> 00:49:39.840
<v Christopher Ariza>And this came out of,

00:49:40.020 --> 00:49:43.040
<v Christopher Ariza>so in implementing concurrency for static frame,

00:49:43.220 --> 00:49:49.720
<v Christopher Ariza>I put the opportunity to use multiprocessing and multithreading because even five or 10 years ago,

00:49:49.840 --> 00:49:55.840
<v Christopher Ariza>I started to see that there were cases where multi-threading standard NumPy would give you

00:49:56.050 --> 00:49:56.700
<v Christopher Ariza>better performance.

00:49:58.000 --> 00:50:02.660
<v Christopher Ariza>But those cases were hard to find and they really had to be tuned.

00:50:03.360 --> 00:50:04.080
<v Christopher Ariza>And that

00:50:04.240 --> 00:50:08.400
<v Christopher Ariza>really depended on how much work was happening purely in NumPy C code,

00:50:08.630 --> 00:50:09.620
<v Christopher Ariza>where it often releases

00:50:09.670 --> 00:50:12.840
<v Christopher Ariza>the GIL versus how much work was happening at the Python layer.

00:50:13.260 --> 00:50:14.820
<v Christopher Ariza>So with this next set of examples,

00:50:14.920 --> 00:50:18.840
<v Christopher Ariza>we have operations that are using intermediate NumPy arrays.

00:50:19.120 --> 00:50:21.580
<v Christopher Ariza>So we're finding all the even numbers.

00:50:21.720 --> 00:50:23.320
<v Christopher Ariza>That gives us back a Boolean array.

00:50:23.480 --> 00:50:27.320
<v Christopher Ariza>And then we're using that Boolean array to select a subset from another array.

00:50:27.540 --> 00:50:29.680
<v Christopher Ariza>So while the bulk of the work is in NumPy,

00:50:29.900 --> 00:50:32.740
<v Christopher Ariza>we have intermediary Python objects that are coming back.

00:50:32.960 --> 00:50:36.900
<v Christopher Ariza>And that additional overhead is enough to really tip the scales

00:50:37.220 --> 00:50:39.460
<v Christopher Ariza>where when we remove the gill,

00:50:39.800 --> 00:50:43.740
<v Christopher Ariza>a square two-dimensional array or a wide two-dimensional array

00:50:43.760 --> 00:50:47.740
<v Christopher Ariza>can deliver truly an order of magnitude better performance,

00:50:47.950 --> 00:50:49.520
<v Christopher Ariza>which is my gold standard.

00:50:49.740 --> 00:50:51.760
<v Christopher Ariza>If I can go an order of magnitude faster,

00:50:52.110 --> 00:50:53.500
<v Christopher Ariza>I have every reason to be happy.

00:50:54.420 --> 00:50:54.560
<v Michael Kennedy>Yeah,

00:50:54.840 --> 00:50:55.220
<v Michael Kennedy>absolutely,

00:50:55.380 --> 00:50:55.800
<v Michael Kennedy>absolutely.

00:50:56.360 --> 00:51:01.820
<v Michael Kennedy>So I want to close this out by talking about your thread pool story.

00:51:02.080 --> 00:51:03.680
<v Michael Kennedy>So we've got a thread pool

00:51:03.830 --> 00:51:08.340
<v Michael Kennedy>and we've got a multiprocessing pool in Python since way back when.

00:51:08.640 --> 00:51:11.260
<v Michael Kennedy>The thread pool is of marginal use.

00:51:11.360 --> 00:51:17.100
<v Michael Kennedy>If you're doing certain things where those operations are releasing the gill, then the thread pool can be really valuable.

00:51:17.380 --> 00:51:23.060
<v Michael Kennedy>But if it's all just pure Python and you're not releasing the gill, it's still just kind of serial anyway.

00:51:23.420 --> 00:51:25.960
<v Michael Kennedy>The multiprocessor one, on the other hand, does a lot more.

00:51:26.120 --> 00:51:36.440
<v Michael Kennedy>But you built a cool library that kind of takes some of the best practices around threading and works them into Python based on whether or not the GIL is enabled or not and things like that, right?

00:51:36.780 --> 00:51:37.000
<v Christopher Ariza>Yeah.

00:51:37.440 --> 00:51:41.040
<v Christopher Ariza>So the concurrent futures library in Python is just gorgeous.

00:51:41.160 --> 00:51:49.240
<v Christopher Ariza>I mean, it's been it's one of the one of my favorite Python pieces, and it gives you a singular interface to do multithreading and multiprocessing.

00:51:49.790 --> 00:51:57.340
<v Christopher Ariza>And that made it so easy for me to switch back and forth for the over the last decade and kind of see where our threads working yet, our threads working yet.

00:51:59.120 --> 00:52:05.060
<v Christopher Ariza>And I think they've also added the same interface for sub interpreters, which we haven't talked about today.

00:52:05.190 --> 00:52:08.540
<v Christopher Ariza>But sub interpreters was the other escape hatch for concurrency in Python.

00:52:08.620 --> 00:52:15.560
<v Christopher Ariza>And I think they've made the concurrent futures pool interface available for sub interpreters, which is super cool.

00:52:16.500 --> 00:52:18.240
<v Christopher Ariza>But as we talked about before,

00:52:18.980 --> 00:52:22.560
<v Christopher Ariza>right now and for I'm not sure how many years into the future,

00:52:23.100 --> 00:52:30.080
<v Christopher Ariza>if you want to use free threading, you take a risk that someone's going to use your code and not be running free threaded Python.

00:52:30.540 --> 00:52:34.520
<v Christopher Ariza>either because you're distributing a library and someone might not have free threaded python

00:52:35.120 --> 00:52:40.660
<v Christopher Ariza>or someone's environment they've imported a wheel that's not compatible and the GIL gets re-enabled

00:52:41.020 --> 00:52:46.580
<v Christopher Ariza>so my thinking was if i want to start building code that really is counting on free threaded

00:52:47.100 --> 00:52:55.020
<v Christopher Ariza>availability i i i need a tool that will identify if the GIL is enabled and if the GIL is enabled

00:52:55.460 --> 00:52:58.040
<v Christopher Ariza>stop doing concurrency.

00:52:58.350 --> 00:53:01.660
<v Christopher Ariza>So that's what this conditional futures package is.

00:53:01.660 --> 00:53:03.720
<v Christopher Ariza>And I was really pleased with this title

00:53:03.790 --> 00:53:04.680
<v Christopher Ariza>because I love the idea.

00:53:05.260 --> 00:53:05.880
<v Christopher Ariza>Conditional futures.

00:53:06.310 --> 00:53:09.620
<v Christopher Ariza>You may get a thread pool with threads

00:53:09.940 --> 00:53:12.800
<v Christopher Ariza>or you may get something that looks like a thread pool with threads

00:53:12.800 --> 00:53:15.880
<v Christopher Ariza>but is actually just conventional serial processing.

00:53:16.190 --> 00:53:19.960
<v Christopher Ariza>And what makes the determination is if the gil is enabled.

00:53:20.400 --> 00:53:23.480
<v Christopher Ariza>So we dynamically check before every call.

00:53:23.720 --> 00:53:27.260
<v Christopher Ariza>It's a context manager, just like normal thread pool creation.

00:53:27.670 --> 00:53:29.380
<v Christopher Ariza>It has the same thread pool interface.

00:53:29.760 --> 00:53:30.540
<v Christopher Ariza>It's a subclass.

00:53:30.700 --> 00:53:31.500
<v Christopher Ariza>It's type compatible.

00:53:31.980 --> 00:53:37.120
<v Christopher Ariza>And what it will do is it will use threads if the gil is disabled.

00:53:37.360 --> 00:53:38.500
<v Christopher Ariza>The gil is not disabled.

00:53:38.940 --> 00:53:41.640
<v Christopher Ariza>It will just use the same code,

00:53:41.980 --> 00:53:46.080
<v Christopher Ariza>but only use a single threaded operation in the parent thread.

00:53:46.130 --> 00:53:47.500
<v Christopher Ariza>It won't even spawn a new thread,

00:53:47.940 --> 00:53:49.320
<v Christopher Ariza>really giving you the best of both worlds.

00:53:49.680 --> 00:53:53.020
<v Michael Kennedy>This is great because it lets you write code,

00:53:53.360 --> 00:53:57.060
<v Michael Kennedy>if I get to the right one, it lets you write code as if it was multi-threaded.

00:53:57.350 --> 00:53:59.000
<v Michael Kennedy>And then it kind of degrades to,

00:53:59.220 --> 00:53:59.480
<v Michael Kennedy>well,

00:53:59.660 --> 00:54:01.000
<v Michael Kennedy>we can really only have one thread.

00:54:01.300 --> 00:54:03.580
<v Michael Kennedy>So the worker count falls back to one,

00:54:04.050 --> 00:54:04.160
<v Michael Kennedy>right?

00:54:04.360 --> 00:54:06.060
<v Michael Kennedy>But you don't have to do any conditional,

00:54:06.260 --> 00:54:07.480
<v Michael Kennedy>like does the conditionals,

00:54:07.780 --> 00:54:09.780
<v Michael Kennedy>even though it's called conditional thread pool executor.

00:54:09.790 --> 00:54:11.540
<v Michael Kennedy>You don't have to mess with it.

00:54:11.730 --> 00:54:17.080
<v Michael Kennedy>You just treat it like you have free-threaded Python fully and it will manage it, right?

00:54:17.320 --> 00:54:17.740
<v Christopher Ariza>Yeah, exactly.

00:54:17.940 --> 00:54:20.660
<v Christopher Ariza>And it will fall back to just executing in the parent thread.

00:54:20.810 --> 00:54:23.500
<v Christopher Ariza>And again, the reason we need this right now,

00:54:23.670 --> 00:54:25.500
<v Christopher Ariza>if you're trying to rely on free threaded Python,

00:54:25.960 --> 00:54:29.900
<v Christopher Ariza>is that if you happen, if your code happens to run with the gil enabled,

00:54:30.070 --> 00:54:32.440
<v Christopher Ariza>your performance will degrade materially,

00:54:32.660 --> 00:54:33.700
<v Christopher Ariza>like very bad.

00:54:34.100 --> 00:54:38.880
<v Christopher Ariza>So it's like to avoid that, we can just fall back into running everything in the parent thread,

00:54:39.750 --> 00:54:40.940
<v Christopher Ariza>not creating any new threads.

00:54:41.260 --> 00:54:43.500
<v Christopher Ariza>But this gives us one Python interface to do that.

00:54:43.640 --> 00:54:45.320
<v Michael Kennedy>And to be clear, when you say it degrades,

00:54:45.380 --> 00:54:48.600
<v Michael Kennedy>It doesn't mean if I could have got a 5x speed up with threading,

00:54:48.820 --> 00:54:50.820
<v Michael Kennedy>it only gives you one.

00:54:51.180 --> 00:54:54.220
<v Michael Kennedy>It's actually slower than single threaded work.

00:54:54.380 --> 00:54:57.460
<v Michael Kennedy>Like it adds all this overhead of the threads and the context and the memories,

00:54:57.900 --> 00:54:58.340
<v Michael Kennedy>but it doesn't

00:54:58.340 --> 00:54:59.960
<v Michael Kennedy>have any more compute to hand to it.

00:54:59.960 --> 00:55:03.100
<v Michael Kennedy>So it just slows down slower than if you did never do any threading, right?

00:55:03.320 --> 00:55:03.520
<v Christopher Ariza>Yeah,

00:55:03.700 --> 00:55:04.000
<v Christopher Ariza>absolutely.

00:55:04.120 --> 00:55:05.060
<v Christopher Ariza>It can be really bad.

00:55:05.460 --> 00:55:06.420
<v Christopher Ariza>It can be very bad.

00:55:06.780 --> 00:55:14.000
<v Michael Kennedy>And so my big takeaway from your talk was I knew about a lot of the GIL stuff and I knew

00:55:14.000 --> 00:55:17.620
<v Michael Kennedy>about a lot of the patterns and trade-offs of threading.

00:55:17.880 --> 00:55:19.820
<v Michael Kennedy>I didn't know that GIL could be re-enabled

00:55:20.200 --> 00:55:21.140
<v Michael Kennedy>in free-threaded Python.

00:55:21.480 --> 00:55:22.600
<v Michael Kennedy>That caught me off guard.

00:55:22.880 --> 00:55:22.980
<v Christopher Ariza>Yeah,

00:55:23.160 --> 00:55:23.440
<v Christopher Ariza>yeah.

00:55:23.580 --> 00:55:25.960
<v Christopher Ariza>And that's, I think, it's a curious choice,

00:55:26.400 --> 00:55:29.420
<v Christopher Ariza>but I think it's the strange period we're in right now.

00:55:30.500 --> 00:55:32.120
<v Christopher Ariza>And so it is, I think, the number one thing

00:55:32.120 --> 00:55:33.100
<v Christopher Ariza>for people to watch out,

00:55:33.400 --> 00:55:33.540
<v Christopher Ariza>again,

00:55:33.680 --> 00:55:35.460
<v Christopher Ariza>if they're starting to try to depend

00:55:36.060 --> 00:55:37.100
<v Christopher Ariza>on free-threaded Python,

00:55:37.220 --> 00:55:39.840
<v Christopher Ariza>and especially if they want to distribute libraries

00:55:40.240 --> 00:55:41.620
<v Christopher Ariza>that depend on free-threaded Python,

00:55:41.680 --> 00:55:47.020
<v Christopher Ariza>because you just don't know which version of Python your users are going to use

00:55:47.500 --> 00:55:50.160
<v Christopher Ariza>or if they're going to implement a wheel that re-enables the guild.

00:55:50.320 --> 00:55:51.080
<v Michael Kennedy>I think that's also,

00:55:51.320 --> 00:55:54.920
<v Michael Kennedy>you know, I kind of lamented that a lot of folks in the Python space

00:55:55.240 --> 00:55:57.520
<v Michael Kennedy>aren't thinking about parallelism, deadlocks, race conditions,

00:55:57.840 --> 00:55:58.040
<v Michael Kennedy>et cetera.

00:55:58.460 --> 00:56:04.400
<v Michael Kennedy>I think a lot of where the free threading Python stuff is going to show up is in libraries and stuff.

00:56:04.420 --> 00:56:07.120
<v Michael Kennedy>And people may not even directly interact with it.

00:56:07.380 --> 00:56:07.520
<v Christopher Ariza>Yep.

00:56:08.020 --> 00:56:08.100
<v Michael Kennedy>Right.

00:56:08.280 --> 00:56:11.300
<v Michael Kennedy>But they're like, well, I got this other library and it's really fast because it's free threaded.

00:56:11.640 --> 00:56:13.600
<v Michael Kennedy>All I did is call the one, you know,

00:56:13.780 --> 00:56:16.440
<v Michael Kennedy>non-async function and it just ran.

00:56:16.490 --> 00:56:17.160
<v Michael Kennedy>But internally,

00:56:17.310 --> 00:56:19.760
<v Michael Kennedy>it did something like your conditional thread pool or something.

00:56:20.020 --> 00:56:24.580
<v Christopher Ariza>Yeah, and that's why I'm so excited about this because in Python,

00:56:24.760 --> 00:56:28.480
<v Christopher Ariza>the opportunities for using concurrency were very few.

00:56:28.780 --> 00:56:33.260
<v Christopher Ariza>They were big, heavy processes that use multiprocessing that you would never really,

00:56:33.480 --> 00:56:35.520
<v Christopher Ariza>that wouldn't work with threading.

00:56:35.880 --> 00:56:46.580
<v Christopher Ariza>And you wouldn't really put into a library because a library can't make assumptions about number of cores or amount of work to really tune the concurrency to be sure that you would get a benefit.

00:56:46.970 --> 00:56:48.220
<v Christopher Ariza>But for the first time in Python,

00:56:48.370 --> 00:56:51.820
<v Christopher Ariza>we now have lightweight true thread concurrency.

00:56:52.210 --> 00:57:01.160
<v Christopher Ariza>That means that there's this whole range of small to middle sized work units that can now take advantage of concurrency and deliver material results.

00:57:01.540 --> 00:57:05.300
<v Christopher Ariza>Lots of little bits of concurrency that we just didn't have access to before.

00:57:05.800 --> 00:57:07.160
<v Christopher Ariza>And so, yeah, I think you're exactly right.

00:57:07.440 --> 00:57:21.140
<v Christopher Ariza>Library authors and maintainers can start to integrate multi-threaded routines into standard operations and have good confidence that their users on whatever system they're running are going to get good results.

00:57:21.540 --> 00:57:21.940
<v Michael Kennedy>For sure.

00:57:22.280 --> 00:57:23.860
<v Michael Kennedy>Also mentioned talking to your agents.

00:57:24.760 --> 00:57:29.780
<v Michael Kennedy>We talked about making them more friendly, but specifically with regard to concurrency.

00:57:30.220 --> 00:57:30.500
<v Christopher Ariza>Yeah.

00:57:30.800 --> 00:57:37.280
<v Christopher Ariza>So this is one of my favorite points is that agents generally in Python,

00:57:37.480 --> 00:57:38.980
<v Christopher Ariza>I found them to be serial first.

00:57:39.140 --> 00:57:44.880
<v Christopher Ariza>But even in Rust, a language that has excellent multi-threaded support and libraries,

00:57:45.780 --> 00:57:49.460
<v Christopher Ariza>I find the agents to be serial first.

00:57:49.980 --> 00:57:57.280
<v Christopher Ariza>an example in python is a situation where you're downloading a bunch of files in a loop this is the

00:57:57.480 --> 00:58:02.820
<v Christopher Ariza>classic example of where python threading has always been effective and you may not want to

00:58:02.850 --> 00:58:06.980
<v Christopher Ariza>write that little additional code to make it free threaded but if you just select that code and say

00:58:06.990 --> 00:58:12.140
<v Christopher Ariza>hey make this free threaded your agent will do it and but it takes looking at the code realizing it's

00:58:12.160 --> 00:58:12.400
<v Christopher Ariza>serial,

00:58:12.920 --> 00:58:13.840
<v Christopher Ariza>and then asking.

00:58:14.600 --> 00:58:16.320
<v Christopher Ariza>And then on the Rust side,

00:58:17.200 --> 00:58:19.120
<v Christopher Ariza>you know, libraries like Rayon provide

00:58:19.660 --> 00:58:22.680
<v Christopher Ariza>really awesome high level tools to, for example,

00:58:22.880 --> 00:58:25.180
<v Christopher Ariza>if you have a loop that's computing,

00:58:25.340 --> 00:58:25.840
<v Christopher Ariza>doing a bunch

00:58:25.840 --> 00:58:27.840
<v Christopher Ariza>of work on each iteration of that loop,

00:58:28.300 --> 00:58:32.180
<v Christopher Ariza>Rayon gives you very nice high level utilities to make

00:58:32.480 --> 00:58:35.100
<v Christopher Ariza>those work units multi-threaded.

00:58:35.480 --> 00:58:39.000
<v Christopher Ariza>And again, I find that the agents don't reach for that first,

00:58:39.040 --> 00:58:41.060
<v Christopher Ariza>you really need to prod them and say,

00:58:41.200 --> 00:58:44.140
<v Christopher Ariza>hey, use Rayon to make this loop multi-threaded

00:58:44.360 --> 00:58:46.720
<v Christopher Ariza>and it'll do it and it'll be great.

00:58:46.980 --> 00:58:47.300
<v Michael Kennedy>That's awesome.

00:58:47.300 --> 00:58:48.180
<v Christopher Ariza>Most of the time, most of the time.

00:58:49.920 --> 00:58:50.360
<v Michael Kennedy>That's fair,

00:58:50.840 --> 00:58:51.160
<v Michael Kennedy>that's fair.

00:58:51.320 --> 00:58:52.580
<v Michael Kennedy>Most of the time this threading will be great.

00:58:52.880 --> 00:58:55.500
<v Michael Kennedy>Except for when your program just doesn't respond

00:58:56.260 --> 00:58:58.500
<v Michael Kennedy>and it has zero CPU usage and you're just like, why?

00:58:59.200 --> 00:59:00.140
<v Michael Kennedy>What is happening there?

00:59:01.260 --> 00:59:01.480
<v Michael Kennedy>Bingo.

00:59:02.200 --> 00:59:02.540
<v Christopher Ariza>Yeah, yeah,

00:59:02.840 --> 00:59:02.960
<v Christopher Ariza>yeah.

00:59:03.500 --> 00:59:03.840
<v Michael Kennedy>All right, Chris.

00:59:04.200 --> 00:59:04.280
<v Michael Kennedy>Well,

00:59:04.620 --> 00:59:06.740
<v Michael Kennedy>that's probably what we got time to cover.

00:59:07.120 --> 00:59:10.520
<v Michael Kennedy>give people some advice on adopting free-threaded Python,

00:59:10.700 --> 00:59:13.100
<v Michael Kennedy>what we got to look forward to in the next couple of years.

00:59:13.380 --> 00:59:13.500
<v Christopher Ariza>Great.

00:59:13.880 --> 00:59:19.000
<v Christopher Ariza>Thanks. Yeah, I'm eager to see this evolve in the Python community.

00:59:19.200 --> 00:59:21.560
<v Christopher Ariza>You know, as I said in my talk,

00:59:21.940 --> 00:59:26.780
<v Christopher Ariza>there's a lot of effort has been put towards making Python faster over the last three to five years.

00:59:26.920 --> 00:59:28.760
<v Christopher Ariza>And a lot of those that work,

00:59:28.920 --> 00:59:30.060
<v Christopher Ariza>we've seen the benefits.

00:59:31.280 --> 00:59:40.620
<v Christopher Ariza>But I feel this one is a real game changer for certain kinds of work that really will be a much more material benefit for a lot of folks.

00:59:40.920 --> 00:59:41.340
<v Michael Kennedy>I agree.

00:59:41.620 --> 00:59:45.400
<v Michael Kennedy>We can make our libraries 30% faster, and that's a lot to celebrate.

00:59:45.820 --> 00:59:48.380
<v Michael Kennedy>But if we can make it run actually on 20 cores,

00:59:48.720 --> 00:59:49.820
<v Michael Kennedy>that's more than 30%.

00:59:50.440 --> 00:59:50.840
<v Christopher Ariza>Exactly.

00:59:51.620 --> 00:59:51.900
<v Christopher Ariza>That's right.

00:59:52.220 --> 00:59:52.440
<v Michael Kennedy>All right.

00:59:52.860 --> 00:59:53.400
<v Michael Kennedy>Thanks for being here.

00:59:53.720 --> 00:59:57.580
<v Michael Kennedy>It's been really fun to dive into this free threading thing, and your talk was really great.

00:59:57.660 --> 00:59:58.600
<v Michael Kennedy>So I'll link to it.

00:59:58.620 --> 01:00:00.120
<v Michael Kennedy>People can check it out when it comes out.

01:00:00.380 --> 01:00:00.500
<v Christopher Ariza>Great.

01:00:00.760 --> 01:00:00.880
<v Christopher Ariza>Thanks.

01:00:00.990 --> 01:00:01.400
<v Christopher Ariza>Happy to be here.

01:00:01.610 --> 01:00:01.920
<v Michael Kennedy>See you later.

01:00:02.180 --> 01:00:02.380
<v Christopher Ariza>All right.

01:00:02.500 --> 01:00:02.620
<v Christopher Ariza>Thank you.

01:00:03.800 --> 01:00:05.920
<v Michael Kennedy>This has been another episode of Talk Python To Me.

01:00:06.300 --> 01:00:07.020
<v Michael Kennedy>Thank you to our sponsors.

01:00:07.250 --> 01:00:08.520
<v Michael Kennedy>Be sure to check out what they're offering.

01:00:08.710 --> 01:00:10.080
<v Michael Kennedy>It really helps support the show.

01:00:10.780 --> 01:00:12.760
<v Michael Kennedy>It's Black Friday week here at Talk Python.

01:00:13.040 --> 01:00:16.660
<v Michael Kennedy>The entire library is $50 off with the Everything Bundle.

01:00:17.120 --> 01:00:19.540
<v Michael Kennedy>And there's a new starter set of courses,

01:00:19.950 --> 01:00:20.500
<v Michael Kennedy>four courses,

01:00:21.140 --> 01:00:23.720
<v Michael Kennedy>for learning Python in the age of AI.

01:00:24.170 --> 01:00:25.640
<v Michael Kennedy>And that's only $56.

01:00:26.480 --> 01:00:32.260
<v Michael Kennedy>The Talk Python in production book is 25% off and membership at Talk Python is 30% off,

01:00:32.480 --> 01:00:34.860
<v Michael Kennedy>which gets you into our discords and monthly meetups.

01:00:35.480 --> 01:00:37.940
<v Michael Kennedy>Visit talkpython.fm/Black Friday.

01:00:38.680 --> 01:00:40.200
<v Michael Kennedy>The sales end December 2nd.

01:00:40.640 --> 01:00:41.780
<v Michael Kennedy>Thanks for supporting the show.

01:00:42.420 --> 01:00:44.300
<v Michael Kennedy>If you or your team needs to learn Python,

01:00:44.480 --> 01:00:49.340
<v Michael Kennedy>we have over 270 hours of beginner and advanced courses on topics ranging from

01:00:49.900 --> 01:00:52.060
<v Michael Kennedy>complete beginners to async code, Flask,

01:00:52.280 --> 01:00:52.480
<v Michael Kennedy>Django,

01:00:52.900 --> 01:00:53.040
<v Michael Kennedy>HTML,

01:00:53.520 --> 01:00:54.520
<v Michael Kennedy>and even LLMs.

01:00:54.780 --> 01:00:55.260
<v Michael Kennedy>Best of all,

01:00:55.500 --> 01:00:57.080
<v Michael Kennedy>there's no subscription in sight.

01:00:57.740 --> 01:00:59.400
<v Michael Kennedy>Browse the catalog at talkpython.fm.

01:01:00.140 --> 01:01:02.060
<v Michael Kennedy>And if you're not already subscribed to the show

01:01:02.300 --> 01:01:03.460
<v Michael Kennedy>on your favorite podcast player,

01:01:04.110 --> 01:01:04.760
<v Michael Kennedy>what are you waiting for?

01:01:05.440 --> 01:01:07.180
<v Michael Kennedy>Just search for Python in your podcast player.

01:01:07.340 --> 01:01:08.180
<v Michael Kennedy>We should be right at the top.

01:01:08.600 --> 01:01:10.000
<v Michael Kennedy>If you enjoyed that geeky rap song,

01:01:10.210 --> 01:01:11.360
<v Michael Kennedy>you can download the full track.

01:01:11.590 --> 01:01:13.480
<v Michael Kennedy>The link is actually in your podcast blur show notes.

01:01:14.320 --> 01:01:14.940
<v Michael Kennedy>This is your host,

01:01:15.160 --> 01:01:15.640
<v Michael Kennedy>Michael Kennedy.

01:01:16.040 --> 01:01:17.100
<v Michael Kennedy>Thank you so much for listening.

01:01:17.310 --> 01:01:18.100
<v Michael Kennedy>I really appreciate it.

01:01:18.540 --> 01:01:19.240
<v Michael Kennedy>I'll see you next time.

01:01:31.120 --> 01:01:33.920
I'm out.