Advertisement
para_bellum

Python performance profiling using cProfile

Jul 3rd, 2017
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. Generate the profile:
  2. $ python -m cProfile -o phoney.cprof phoney.py
  3.  
  4. Then, transform it into something readable by Kcachegrind:
  5. $ python pyprof2calltree.py -k -i /home/para/dev/metis_unicorn/script/phoney.cprof
  6.  
  7. Or read it directly using RunSnakeRun
  8.  
  9. Bear in mind that cProfile does very badly with multi-process.
  10.  
  11. Ressources:
  12. https://julien.danjou.info/blog/2015/guide-to-python-profiling-cprofile-concrete-case-carbonara
  13. https://stackoverflow.com/questions/582336/how-can-you-profile-a-script
  14. http://lanyrd.com/2013/pycon/scdywg/
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement