PYME.util.mProfile.mProfile module¶
mProfile.py - Matlab(TM) style line based profiling for Python
- Copyright: David Baddeley 2008
david_baddeley <at> yahoo.com.au
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 …).
e.g.
mProfile.profileOn([‘onefile.py’, ‘anotherfile.py’])
stuff to be profiled ….
mProfile.profileOff() mProfile.report()
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() -> new empty dictionary dict(mapping) -> new dictionary initialized from a mapping object's (key, value) pairs dict(iterable) -> new dictionary initialized as if via: d = {} for k, v in iterable: d[k] = v dict(**kwargs) -> new dictionary initialized with the name=value pairs in the keyword argument list. For example: dict(one=1, two=2)¶
Bases:
dict
- class PYME.util.mProfile.mProfile.mydictn() -> new empty dictionary dict(mapping) -> new dictionary initialized from a mapping object's (key, value) pairs dict(iterable) -> new dictionary initialized as if via: d = {} for k, v in iterable: d[k] = v dict(**kwargs) -> new dictionary initialized with the name=value pairs in the keyword argument list. For example: dict(one=1, two=2)¶
Bases:
dict
- PYME.util.mProfile.mProfile.profileOff()¶
- PYME.util.mProfile.mProfile.profileOn(fnames)¶
- PYME.util.mProfile.mProfile.report(display=True, profiledir=None)¶
- PYME.util.mProfile.mProfile.te(frame, event, arg)¶