← Useful Tips
Python / DataPython

python -m cProfile script.py: Profile which Python functions consume the most time

Use python -m cProfile script.py to profile which Python functions consume the most time. It improves repeatability and debugging in Python and data workflows.

python -m cProfile script.py

Why it helps

Use python -m cProfile script.py to profile which Python functions consume the most time. It improves repeatability and debugging in Python and data workflows.

How to use it

  1. Open the relevant app or terminal.
  2. Use the shortcut or command above in the relevant context.
  3. Check the result; for commands that change data, test on a small example first.
People also search for
python -m cProfile script.py: Profile which Python functions consume the most timepython -m cProfile script.pyprofile which python functions consume the most timehow to profile which python functions consume the most timePython / Data profile which python functions consume the most time

Related tips