Python Memory Management and Tips Transcripts
Chapter: Efficient data structures
Lecture: Data struct chapter intro
0:00 So what we've done so far is we've tried to understand python memory management techniques and
0:05 how it works. We've talked about allocation,
0:08 we've talked about cleanup with reference counting and how they're problems with reference counting.
0:11 So there's also this garbage collection thing and so on.
0:14 All of that was kind of FYI,
0:16 so you'd have a better understanding,
0:18 right? Well, what we want to accomplish is to come out of this course
0:22 not just with a better understanding,
0:24 but with the ability to actually make decisions that can dramatically improve the amount of memory
0:30 we use, by making it less, or speed up things,
0:34 or ideally, both. So we're going to start down that path in this chapter
0:38 and carry on in the chapters that follow.
0:42 So let's start by talking about the goals of this chapter.
0:46 To some degree, you're going to see that what we can do will actually make
0:50 things better. But also, sometimes it's just easier to go with the grain and
0:56 understanding how the garbage collector and reference counting and allocation works,
1:01 you can either go with the grain or you can go against it.
1:04 Obviously, working with the way that Python is already gonna work is good.
1:09 It's better. So I want you to keep this in mind
1:12 as we were talking about all of these things and especially looking back at what we've
1:15 done, it's important to just know what the direction of the grain is,
1:20 what the way the system wants to work so that you can not fight it
1:24 and work along with it. But again,
1:26 in this chapter, but especially the next,
1:28 we're gonna be looking at some actual techniques that will let you change the way things
1:32 work or maybe do this to an extreme where we actually change the performance in really important ways.