PYME.util.mProfile.mProfile module - Matlab(TM) style line based profiling for Python

Copyright: David Baddeley 2008
david_baddeley <at>

useage is similar to profiling in matlab (profile on, profile off, report), with the major difference being that you have to specify the filenames in which you want to do the profiling (to improve performance & to save wading through lots of standard library code etc …).


mProfile.profileOn([‘’, ‘’])

stuff to be profiled ….


Due to the fact that we’re doing this in python, and hooking every line, there is a substantial performance hit, although for the numeric code I wrote it for (lots of vectorised numpy/scipy stuff) it’s only on the order of ~30%.

Licensing: Take your pick of BSD or GPL

class PYME.util.mProfile.mProfile.mydict(*args)

Bases: dict

class PYME.util.mProfile.mProfile.mydictn(*args)

Bases: dict

PYME.util.mProfile.mProfile.profileOn(fnames), profiledir=None)
PYME.util.mProfile.mProfile.te(frame, event, arg)