Effective PyCharm Transcripts
Chapter: Performance and profiling
Lecture: Our intuition often fails us for performance
0:00 As we get into this profiling topic, I want to really drive homeless idea that guessing and using your intuition for what part
0:08 of your program is slow and what part is fast? It often fails us. In more than one time in my career.
0:15 I've been working on some code and some program and it's really slow and like, wow, this is the little section I need to focus on because I'm sure this
0:24 looks complicated. Seems like it's doing a lot. This must be the problem. And it turns out that was only 5% of the
0:31 time. There was some other section I didn't even come aware of that was 95% of the time. And if I could have completely erased all the time spent on
0:39 where I thought it was slow, it would have only made it 5% faster. It still would have been basically slow.
0:45 So what we're going to learn in this chapter is how do we measure? We measure what our program is doing and where is spending its time.
0:52 And then we can go with that more accurate information, dive in and start using our programming experience to make that bit of code faster.
1:01 So before you just dive in and try to make something fast and optimize it and make it potentially complicated, remember measure and then work on it.