---------- Forwarded message ----------
From: Stefan Behnel <stefan_ml@behnel.de>
To: pyrex@lists.copyleft.no
Date: Wed, 01 Dec 2010 08:41:56 +0100
Subject: Re: [Pyrex] profiling in pyrex
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

I use oprofile, which doesn't properly report python code, but catches pyrex code without issue (since it's like any other C code).