cProfile and pstats
Profile which functions take the most time.
Intermediate
python -m cProfile -o prof.out app.py
python -c "import pstats; pstats.Stats('prof.out').sort_stats('cumtime').print_stats(15)"
Visualise with snakeviz.
Spotted a mistake or want to add detail? Suggest an improvement — Content Contributors' edits are reviewed by editors before they go live.
Discussion (0)
Sign in or join free to ask questions and discuss this topic.