tubeshowcase●1,114,647 videos♡ My collection 0
← Learn to Code

Learn to Code09:57

Diagnose slow Python code. (Feat. async/await)

mCoding ↗

From the creator

Where is the slow coming from? 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. ― mCoding with James Murphy (https://mcoding.io) Source code: https://github.com/mCodingLLC/VideosSampleCode cProfile docs: https://docs.python.org/3/library/profile.html snakeviz: https://jiffyclub.github.io/snakeviz/ httpx: https://www.python-httpx.org/ SUPPORT ME ⭐ --------------------------------------------------- Patreon: https://patreon.com/mCoding Paypal: https://www.paypal.com/donate/?hosted_button_id=VJY5SLZ8BJHEE Other donations: https://mcoding.io/donate Top patrons and donors: John M, Laura M, Pieter G, Vahnekie, Sigmanificient BE ACTIVE IN MY COMMUNITY 😄 --------------------------------------------------- Discord: https://discord.gg/Ye9yJtZQuN Github: https://github.com/mCodingLLC/ Reddit: https://www.reddit.com/r/mCoding/ Facebook: https://www.facebook.com/james.mcodin

Published 2021-06-26 · Watch on YouTube ↗
Availability and playback restrictions are controlled by the original channel.

Keep exploring Learn to Code