[Pyrex] profiling in pyrex

Stefan Behnel stefan_ml at behnel.de
Wed Dec 1 08:41:56 CET 2010


Mihai Badoiu wrote:
> what is the best way to profile code written in pyrex?

Cython has Python profiling support. You can compile a module with 
profiling enabled, and it will trace function calls into cProfile, even 
calls to cdef functions.

http://docs.cython.org/src/tutorial/profiling_tutorial.html

If you need more low-level profiling data, use valgrind's callgrind. It has 
a great visualisation tool available that is called kcachegrind.

Stefan



More information about the Pyrex mailing list