...

/

Memory and CPU Profiling

Memory and CPU Profiling

Learn about memory and CPU profiling in Python.

We'll cover the following...

Profiling a Python program means doing a dynamic analysis that measures the execution time of the program and everything that involves. That means measuring the time spent in each of its functions. This data gives you info about where your program is spending time, and what area might be worth optimizing.

This is a very interesting exercise. Many people focus on local optimization, such as determining, for example, which of the Python 2 functions range or xrange is going to be faster. It turns out that knowing which one is faster may never be an issue in your program, and that the time gained by using one of the functions above might not be worth the time you spend researching it or arguing about it with your colleague.

Trying to blindly optimize a program ...

Access this course and 1400+ top-rated courses and projects.