Python Profiler Trouble

Scott Brady Drummonds scott.b.drummonds.nospam at intel.com
Tue Feb 24 17:58:28 EST 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
points.

However, when following the instructions for using the profiler at
http://www.python.org/doc/current/lib/profile.html, 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:

<quote>
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
profile:0(marple.main('iecr_new_config.txt'))
        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 marple.py:10(main)


<pstats.Stats instance at 0xbd75fcc>
</quote>

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?

Thanks!
Scott

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





More information about the Python-list mailing list