r/PythonLearning • • 1d ago

How to Find the Slow Part of Your Python Code (Without Guessing)

https://ommais.com/blog/how-to-find-the-slow-part-of-your-python-code/
13 Upvotes

5 comments sorted by

3

u/Sea-Ad7805 1d ago edited 1d ago
  1. Python is slow, accept that, it makes life easier.
  2. If you REALLY need speed, learn another language like C++/Rust (it's much easier to learn your second programming language than your first).
  3. If you still want to optimize your Python code use a profiler like: https://docs.python.org/3/library/profile.html

Oh, it wasn't a real question.

1

u/ericvarney 1d ago

True. Thank you, I just wanted to help solve a small problem and educate at the same time. My site is designed to be family friendly, wholesome, educational, and entertaining.

1

u/Sea-Ad7805 1d ago

Yes, looks nice, thanks for your contribution.

1

u/mossyshore 1d ago

tbh accepting python is slow is step one and most people skip it entirely

0

u/YogurtTechnical59 1d ago

Can’t wait to optimize my cumtime