Python Profiler Trouble

Scott Brady Drummonds scott.b.drummonds.nospam at
Tue Feb 24 23:58:28 CET 2004

Hi, everyone,

I have a tool I've written in Python that is taking many hours to run but I
believe could be running in less than an hour with a more clever
implementation.  As such, I'm trying to use the profiler to spot the weak

However, when following the instructions for using the profiler at, I'm not having any luck.
I've tried letting the program run for about five or ten minutes then
killing it with ^C but no useful data are returned:

Tue Feb 24 14:40:38 2004    prof

         3 function calls in 0.000 CPU seconds

   Random listing order was used

   ncalls  tottime  percall  cumtime  percall filename:lineno(function)
        1    0.000    0.000    0.000    0.000
        1    0.000    0.000    0.000    0.000 <string>:1(?)
        0    0.000             0.000          profile:0(profiler)
        1    0.000    0.000    0.000    0.000

<pstats.Stats instance at 0xbd75fcc>

Is this because I'm hitting ^C before it finishes?  Do I have to let the
program run to completion to get good results?  Since I don't want to wait
the many hours (or even many days) for this profiling info, is there a
better way that I can profile portions of the this large test case rapidly?


Remove ".nospam" from the user ID in my e-mail to reply via e-mail.

More information about the Python-list mailing list