Profiling Python using gprof

jepler at jepler at
Wed Oct 12 03:59:49 CEST 2005

It should be the same as for any program....

$ program-compiled-with-pg
$ gprof /path/to/program-compiled-with-pg

you'll need to make sure that python is not only *compiled* with -pg
but that the *link line* contains -pg as well.  That's a common "gotcha" when
it comes to profiling.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 196 bytes
Desc: not available
URL: <>

More information about the Python-list mailing list