Message181707
While we're on profile convenience features, how about adding two context managers:
- one that just profiles a block and prints the profile (or dumps the data to a file)
- one that takes a Profile instance and enables profiling to that instance
E.g. (1)
with cProfile.runblock([file]):
<your code here>
or (2)
p = cProfile.Profile()
with p:
<your code here>
Also a decorator corresponding to (1):
@cProfile.runfunc([filename])
def myfunc(args):
<stuff> |
|
Date |
User |
Action |
Args |
2013-02-09 00:16:18 | gvanrossum | set | recipients:
+ gvanrossum, eric.araujo |
2013-02-09 00:16:18 | gvanrossum | set | messageid: <1360368978.08.0.916375749369.issue17130@psf.upfronthosting.co.za> |
2013-02-09 00:16:18 | gvanrossum | link | issue17130 messages |
2013-02-09 00:16:17 | gvanrossum | create | |
|