What mechanisms does IPython provide for profiling code and scripts?
I found this interesting thread (March 2013) that suggests defining custom magics that wrap calls to other Python modules: line-profiler
, psutil
, memory_profiler
.
However, looking at the GitHub discussions, I also found this issue (already closed) where Fernando, tk and other core IPython developers discuss the inclusion of magics by default in IPython for profiling.
All that said I could not find any information about profiling in the official dev documentation.
I am currently using the master branch of IPython. How can I profile a given script e.g. foo.py
either line-by-line or by function call?