Skip to content

Instantly share code, notes, and snippets.

@4383
Created November 13, 2018 17:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save 4383/e6469181ce2e16258dffbc664850f514 to your computer and use it in GitHub Desktop.
Save 4383/e6469181ce2e16258dffbc664850f514 to your computer and use it in GitHub Desktop.
debug with kcachegrind
import cProfile
pr = cProfile.Profile()
pr.enable()
# execute python code to profile
print("test")
pr.disable()
pr.dump_stats("/tmp/debug.cprof")
pyprof2calltree -k -i /tmp/debug.prof
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment