[Cython] optimization tips...?

Stefan Behnel stefan_ml at behnel.de
Tue Apr 28 16:11:47 CEST 2009


Stefan Behnel wrote:
> Jean-Francois Moulin wrote:
>> One more question related to this... I do I profile a cython file (the
>> info from the
>> python profiler is no longer split into the different subfunctions...)?
>
> If you're on Linux, use valgrind's callgrind and kcachegrind. It will give
> you clickable call graphs with relative timings per branch, and timing
> annotated C sources. Perfect for finger pointing.

... although, after reading your source, I recommend taking a look at the
generated C source first. It will give you all sorts of ideas what to do
to remove unnecessary Python object creations and to reduce general Python
interaction.

Stefan



More information about the Cython-dev mailing list