Profiling in python is very handy. It will help you to monitor your code performance and find the hot spot of your code.
Here I am using cProfile for profiling. It is built in with python.
Download sample code , unzip the file and cd to the folder.
No run this command python -m cProfile a.py
Output will be
Visualization of cProfile data:
I used RunSnakeRun for visualization.
Now run this following two command (make sure you installed RunSnakeRun)
python -m cProfile -o file.prof a.py
runsnake file.prof
Output will be
Here I am using cProfile for profiling. It is built in with python.
Download sample code , unzip the file and cd to the folder.
No run this command python -m cProfile a.py
Output will be

Visualization of cProfile data:
I used RunSnakeRun for visualization.
Now run this following two command (make sure you installed RunSnakeRun)
python -m cProfile -o file.prof a.py
runsnake file.prof
Output will be

Check it out.
0 comments:
Post a Comment