[Python-Dev] RFC: Threading-Aware Profiler for Python

Aahz aahz at pythoncraft.com
Mon May 4 17:56:04 CEST 2009


On Mon, May 04, 2009, Christian Schubert wrote:
>
> Python ships with a profiler module which, unfortunately, is almost
> useless in a multi-threaded environment. *
>
> I've created an alternative profiler module which queries per-thread
> CPU usage via netlink/taskstats, which limits the applicability to
> Linux (which shouldn't be much of an issue, profiling is usually
> not done by end users). It implements two modes: a "sampling" (does
> CPU time accounting based on stack fraames 100 times per second, by
> default) and a "deterministic" profiler (does CPU time accounting
> on each function call/return, based on sys.profiler interface). The
> deterministic profiler is currently implemented in pure python (except
> for taskstats interface) and much slower than the sampling profiler.

If you want to discuss this, please subscribe to python-ideas and repost
your message.  Generally speaking, in order to include modules like this,
they need to prove themselves over time and may require PEP approval.  If
you choose to move the discussion to python-ideas, it would help if you
mention known uses of your module.
-- 
Aahz (aahz at pythoncraft.com)           <*>         http://www.pythoncraft.com/

"It is easier to optimize correct code than to correct optimized code."
--Bill Harlan


More information about the Python-Dev mailing list