On Jul 14, 2009, at 9:32 AM, Stefan Behnel wrote:

>
> Robert Bradshaw wrote:
>> On Jul 12, 2009, at 8:24 PM, Kurt Smith wrote:
>>
>>> In the midst of GSoC, I wanted to float an idea about a Cython
>>> profiler, similar to the current Python profiler.  Specifically I
>>> wanted to see if there's interest, what sorts of features would be
>>> desired, and, broadly, some implementation ideas.
>
> +1, totally interested.
>
>
>>> I think the arguments in favor are clear:
>>>
>>> Often people use Cython incrementally -- take a .py file, profile  
>>> it,
>>> put the hotspots in Cython.  If fast enough -- you're done.  If not,
>>> continue to put more slow python code into Cython, or determine  
>>> if the
>>> Cython code should be massaged to yield better performance.  In the
>>> latter case it is difficult to zone in on the Cython hotspot, for it
>>> is not possible for the Python profiler to see it.  Other external
>>> tools must be used (gprof?, valgrind, mac os x-specific profiler),
>>> which is inconvenient at best; other times they are just plain
>>> unavailable.
>
> The main problem I always had here is the tool barrier. You can use
> cProfile for profiling Python code, but it can't look into the Cython
> functions. Profiling Cython itself will show you loads of time  
> spent inside
> the main parser function, without further detail. That's not quite the
> right level of granularity for optimisations.

So, I've felt like hacking Cython on my trans-continental flight, and  
got Cython working very nice with cProfile. Of course there's a lot  
of tracing and other things one could want to do from here (e.g. pdb)  
but I don't think I'll have time for that.

I'll push as soon as I have internet access again.

- Robert

_______________________________________________
Cython-dev mailing list
[email protected]
http://codespeak.net/mailman/listinfo/cython-dev

Reply via email to