#100DaysOfCode in Python Transcripts
Chapter: Days 49-51: Measuring performance
Lecture: Your turn: Day 2
Login or
purchase this course
to watch this video and the rest of the course contents.
0:00
Second day, you've already chosen your application. So what we're going to do is we're going to use c profile
0:06
or if you're using PyCharm Pro, you can use the visual profiling tools there, as well. Understand your applications performance.
0:13
So run the cProfile module against your app. You can either use the api for very fine-grained stuff or just run it against your entire application
0:22
like we saw in the command line. Sort probably by cumulative time, cumtime. That'll make it much easier to understand actually where it's slow.
0:31
So you're job for today is to use cProfile to find the five slowest methods in your application. Write them down, make a little chart,
0:40
put them in a text file, something like that. And be sure to include the millisecond times that were recorded.
0:46
That way when you try to improve it on the next day you could actually see if that's an improvement or maybe even makes it worse.
0:52
So just go through, do a little bit of detective work and find the five slowest methods that you control, that you might be able to change.