python - How to profile a cdef function? -
i have application uses many nogil
cdef
function , profile them in order find bottle-necks.
i tried passing profile=true
directive cython these functions seem imune, such output of cprofile.run()
contains timings of functions calling cdef
functions, not of cdef
functions themselves.
is there directive or profiler can used in order profile cdef
functions?
edit: this link application file referring to.... in order profile must set:
#cython: profile=true
at header.
the profiler needs gil
, so, of comments @veedrac, solution to:
- use
cdef
functions withoutnogil
directive - set
#cython: profile=true
@ header of.pyx
(or somewhere else)
the drawback here that, removing nogil
, 1 can not use prange
in order profile parallel execution. question remains... possible profile nogil
function?
Comments
Post a Comment