Find why your Python code is slow using this essential tool. (Feat. async/await)

Find why your Python code is slow using this essential tool. (Feat. async/await)
Find why your Python code is slow using this essential tool. (Feat. async/await)

Sign up on Patreon to get your donor role and early access to videos!
https://patreon.com/mCoding

Feeling generous but don’t have a Patreon? Donate via PayPal! (No sign up needed.)
https://www.paypal.com/donate/?hosted_button_id=VJY5SLZ8BJHEE

Top patrons and donors:
John M, Laura M, Pieter G, Vahnekie, Sigmanificient

IN THIS VIDEO…

How do you make your Python code faster? The first step is measuring what part is actually slow. We do this using a profiler, such a cProfile. The profiler measures how much time all your function calls take and then you can print or save these statistics to determine where you should spend your time improving. Take your profiling to the next level using a graphical tool like snakeviz to analyze the stats.

I go through a simple example where I go from start to finish diagnosing and fixing some slow code using these techniques. Here we ended up using async/await to fix the problem, but the tools in this video can be used to diagnose all sorts of code problems.

CHAPTERS

0:00 Intro
0:45 Example slow code
2:34 Basic profiling
4:27 Snakeviz visualizations
6:04 Speeding up the code
9:04 Improved profile

Suggest:

Async/Awaiting Production in Python

Learn Python in 12 Hours | Python Tutorial For Beginners

Complete Python Tutorial for Beginners (2019)

Python Tutorials for Beginners - Learn Python Online

Python Programming Tutorial | Full Python Course for Beginners 2019

Python Tutorial for Beginners [Full Course] 2019