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 without nogil 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

Popular posts from this blog

windows - Single EXE to Install Python Standalone Executable for Easy Distribution -

c# - Access objects in UserControl from MainWindow in WPF -

javascript - How to name a jQuery function to make a browser's back button work? -