How To FIND SLOW CODE In Python & OPTIMIZE IT (FT. cProfile)
Vložit
- čas přidán 22. 10. 2022
- Today we will be discovering together how we can use cProfile to find slow code in our program, and thanks to this, we can also further optimize our slow code.
Docs: docs.python.org/3/library/pro...
▶ Become job-ready with Python:
www.indently.io
▶ Follow me on Instagram:
/ indentlyreels
3:23 😂 no way he called it that
the what time???
ah my favorite time of the day, let me get my lotion and tissues!
cProfile seems to be a rather helpful tool for development.
As always thanks and 24-th 👍😉!
Can you do a tut of how to protect python code and implant license's system to it? Or even provide me with some useful resources to learn from?, Btw great video. Thanks!
If you want to freeze your Python code to exe then pyinstaller works great
Your channel is a godsend for this knowledge snippets
Grazie bello :) Si sono mezzo Italiano, l'altro mezzo e' un mistero ahah
@@Indently Aahhh lo sapevo!
Bravo! Bel canale
Sei in Danimarca?
@@GooogleGoglee Si! Gia da 7 anni ormai :)
@@Indently hai fatto bene! 👍🏻👋🏻 congratulazioni, beato te! Avrei tante domande da farti ma purtroppo non è il posto giusto.
That's great!
3:32 link is not in the description box :/
But before you post that answer from 10 years ago why not link the latest docs for the stuff?
That's a fair point, it was just faster to find on stack overflow than scrolling down half way through the documentation. But I've gone ahead and included it!
thank you
hey! there's actually a better profiler called scalene, you should check it out
Thanks for the heads up! I will check it out!
its not built-in tho, right? :)
0:56 did you know that Python functions always return None if not explicitly told otherwise?
I think I was a bit zombified from all the recording I did that day ahah. Reminds me of the times I returned True if something was True and False if it wasn't.
true, though sometimes i use it to mean "this returned None for a reason" instead of "this returns None always". ended up saving me some dev time when i found myself writing a "Null" class later
I think Cython (C python)
Is a bit faster than normal python libs
Cython != Cpython
"Normal python libs" could also be compiled with cython. So this statement doesn't make much sense.
You mean code compiled with cython might execute faster than when executed with default cpython?
That might be true. cProfile is still useful.
@@ewerybody thank you, actually I used cython for one time
@@ewerybody I know, but I call it that way for no reason
hi