How do I read the output of the IPython %prun (profiler) command? How do I read the output of the IPython %prun (profiler) command? python python

How do I read the output of the IPython %prun (profiler) command?


It's just a convenient wrapper for Python's own profiler, the documentation for which is here:

http://docs.python.org/library/profile.html#module-pstats

Quoting:

ncalls for the number of calls,

tottime for the total time spent in the given function (and excluding time made in calls to sub-functions),

percall is the quotient of tottime divided by ncalls

cumtime is the total time spent in this and all subfunctions (from invocation till exit). This figure is accurate even for recursive functions.

percall is the quotient of cumtime divided by primitive calls