I am trying to profile a method within a class I created using the line_profiler package. I found an example similar to my situation and in the .pyx, called collatz.pyx, it has
from collatz import CClass
obj = CClass()
func = obj.cp_pymethod
profile = line_profiler.LineProfiler(func)
profile.runcall(func, 19)
assert_stats(profile, func.__name__)
However, when I run the test script, the output which is supposed to be articulate the times of each line in a call to cp_pymethod is instead blank. The output is:
Line # Hits Time Per Hit % Time Line Contents
==============================================================
72 cpdef cp_pymethod(self, r):
Has this issue in line_profiler been resolved yet? If not, are there any other ways to profile a cython method line-by-line?
Thanks!