Python Memory Management and Tips Transcripts
Chapter: Efficient data structures
Lecture: Data struct chapter intro

Login or purchase this course to watch this video and the rest of the course contents.
0:00 So what we've done so far is we've tried to understand Python memory management techniques and how it works. We've talked about allocation,
0:09 we've talked about cleanup with reference counting and how they're problems with reference counting.
0:12 So there's also this garbage collection thing and so on. All of that was kind of FYI, so you'd have a better understanding,
0:19 right? Well, what we want to accomplish is to come out of this course not just with a better understanding,
0:25 but with the ability to actually make decisions that can dramatically improve the amount of memory we use, by making it less, or speed up things,
0:35 or ideally, both. So we're going to start down that path in this chapter and carry on in the chapters that follow.
0:43 So let's start by talking about the goals of this chapter. To some degree, you're going to see that what we can do will actually make
0:51 things better. But also, sometimes it's just easier to go with the grain and
0:57 understanding how the garbage collector and reference counting and allocation works, you can either go with the grain or you can go against it.
1:05 Obviously, working with the way that Python is already gonna work is good. It's better. So I want you to keep this in mind
1:13 as we were talking about all of these things and especially looking back at what we've
1:16 done, it's important to just know what the direction of the grain is, what the way the system wants to work so that you can not fight it
1:25 and work along with it. But again, in this chapter, but especially the next,
1:29 we're gonna be looking at some actual techniques that will let you change the way things
1:33 work or maybe do this to an extreme where we actually change the performance in really important ways.

Talk Python's Mastodon Michael Kennedy's Mastodon