Seeking Help with Profiling C-Implemented Functions in SciPy

Hello SciPy Community,

I am reaching out for some guidance while benchmarking some SciPy functions on two different machines. Initial tests show varied performance between the machines.

Using cProfile I found few bottlenecks, but since these functions are implemented in C, it only shows total runtimes without deeper insights. I’ve tried other profilers like py-spy and line_profiler, but they don’t provide detailed info on the C code.

Any advice on profiling tools or best practices for digging into C-implemented functions within SciPy would be greatly appreciated.

Thanks in advance! :blush:

You need a C profiler, scipy or not :-).
You might have some luck with very new py-spy versions, see https://github.com/benfred/py-spy/issues/2

In the past, I had very good results with google perftools / yep : https://pypi.org/project/yep/, don’t know how well it aged.