[Python-talk] cProfile

Bruce Labitt bruce.labitt at myfairpoint.net
Wed Oct 14 18:58:27 EDT 2009


It struck me that what I really want to do is run a profile on my python 
client code. 
The example given at http://docs.python.org/library/profile.html is that 
of profiling the object foo().

I'd like to profile my whole routine.  Say it is called fftclient.py, 
and we are using ipython.  At the command line would be

 >> import cProfile
 >> cProfile.run('  ??? ','fftclientprof')
 >> import pstats
> > p = pstats.Stats('fftclientprof')
> > p.sort_stats('time').print_stats(10)
What would go in ??? __main__? I'm confused about this...

Thanks,
Bruce

 



More information about the Python-talk mailing list