Benchmarking, Profiling, and Optimizing Your Python Code: Easily Identify Bottlenecks and Efficiently Speed Up Your Python Code

Video description

Some programmers don’t use Python because they think it is too slow. Yet writing fast-enough programs in Python often takes less time than in other languages. In this video, you will learn how to effectively and efficiently speed up your Python programs.

We start by looking at how to measure the speed of a program, so you can see the impact of your changes. And we will discover where your program spends most of its time to help you focus your efforts. You will see how to create performance graphs and drill down into the detail. Next, we move on to optimizing the code by changing the flow and structure. Some approaches take more processing power than others, and we will look at how to use code complexity to express this and help you choose the best algorithm. We will see some examples of switching to a different algorithm and the impact on the code’s speed. You will see some simple techniques to cache the results from your functions. Moving code out of large loops can also have a significant impact. Having restructured the code, you will learn how to speed up individual lines of code. We will look at ten common tasks in Python and compare the different ways to achieve them.

After watching this video, you will be able to measure code performance to see what works, profile your code to discover where to focus, change the code structure and flow to improve speed, and go through your code line by line to use faster Python syntax.

What You Will Learn
  • Benchmark Python code and track the progress of optimization efforts
  • Profile Python code and discover low-hanging fruit to focus your optimization
  • Change the code flow and structure to minimize how much code gets run
  • Choose the fastest Python syntax, line by line, to speed everything up
Who This Video Is For
Intermediate to experienced Python programmers who want to speed up existing Python code and write faster new Python code.




Product information

  • Title: Benchmarking, Profiling, and Optimizing Your Python Code: Easily Identify Bottlenecks and Efficiently Speed Up Your Python Code
  • Author(s): Coen de Groot
  • Release date: November 2020
  • Publisher(s): Apress
  • ISBN: 9781484267769