Profiling Python using gprof

Micah Elliott mde at micah.elliott.name
Tue Oct 11 22:44:22 EDT 2005


On Oct 11, Dave wrote:
> I would like to profile a Python program using gprof. I already
> rebuilt Python with CC="gcc -pg" ./configure. So, I should be able to
> use gprof. How do I do that? Should I first run Python and then gprof?
> What are the steps?

Note that it is much more common to use Python's profiling facilities to
"profile a Python program".  So if you really want to profile the
interpreter running your modules, then go ahead with gprof and follow
Jeff's advice; otherwise see
<http://www.python.org/doc/2.4.2/lib/profile.html>.

-- 
Micah Elliott
<mde at micah.elliott.name>



More information about the Python-list mailing list