Я запускаю это:
In [303]: %prun my_function()
384707 function calls (378009 primitive calls) in 83.116 CPU seconds
Ordered by: internal time
ncalls tottime percall cumtime percall filename:lineno(function)
37706 41.693 0.001 41.693 0.001 {max}
20039 36.000 0.002 36.000 0.002 {min}
18835 1.848 0.000 2.208 0.000 helper.py:119(fftfreq)
- чик -
Что делать каждый из tottime, percall, cumtime? ncalls довольно очевидно (количество раз, когда функция вызывается). Мое предположение заключается в том, что tottime - это общее время, затрачиваемое на выполнение функции, исключая время, затрачиваемое на его собственные вызовы функций; percall -???; cumtime - это общее время, затрачиваемое на вызов функции, включая время, потраченное на его собственные вызовы функций (но, конечно, исключая двойной счет). docs не слишком полезны; Поиск Google не помогает.