Skip to content

Instantly share code, notes, and snippets.

@matrix303
Last active June 25, 2019 18:50
Show Gist options
  • Select an option

  • Save matrix303/a0c94e915afdfd507d3893625b10463c to your computer and use it in GitHub Desktop.

Select an option

Save matrix303/a0c94e915afdfd507d3893625b10463c to your computer and use it in GitHub Desktop.
Profiling Python File RunTime #pythonTips
c_profiler -> gives times of functions
line_profiler -> gives times of line by lie
#@profile -> needed for linebyline
def func():
aklw;ejlkajselksjlkjaslkejawlkjwel;kaj
terminal: python -m cProfile -s cumulative profileme.py
terminal: kernprof -l -v profileme.py #todo cpu profiling line-by-line -> needs @profile for the func you need lbyl for
terminal: python -m memory_profiler profileme.py #todo memory profiling -> need @profile for func you want memory details for
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment