Message181707
| Author |
gvanrossum |
| Recipients |
eric.araujo, gvanrossum |
| Date |
2013年02月09日.00:16:17 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<1360368978.08.0.916375749369.issue17130@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
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> |
|
History
|
|---|
| 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 |
|