#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.
0:03 So what we're going to do is we're going to use c profile
0:05 or if you're using PyCharm Pro, you can use
0:08 the visual profiling tools there, as well.
0:10 Understand your applications performance.
0:12 So run the cProfile module against your app.
0:16 You can either use the api for very fine-grained stuff
0:19 or just run it against your entire application
0:21 like we saw in the command line.
0:23 Sort probably by cumulative time, cumtime.
0:27 That'll make it much easier to understand
0:29 actually where it's slow.
0:30 So you're job for today is to use cProfile
0:33 to find the five slowest methods in your application.
0:37 Write them down, make a little chart,
0:39 put them in a text file, something like that.
0:40 And be sure to include the millisecond times
0:43 that were recorded.
0:45 That way when you try to improve it on the next day
0:47 you could actually see if that's an improvement
0:50 or maybe even makes it worse.
0:51 So just go through, do a little bit of detective work
0:54 and find the five slowest methods that you control,
0:56 that you might be able to change.