我想知道为什么某些函数需要很长时间才能完成。
我使用探查这样的:Python分析器没有提供足够的信息
ipdb> import profile
ipdb> profile.runctx('report.generateOutput()', globals(), locals())
1 function calls in 40.783 CPU seconds
Ordered by: standard name
ncalls tottime percall cumtime percall filename:lineno(function)
0 0.000 0.000 profile:0(profiler)
1 40.783 40.783 40.783 40.783 profile:0(report.generateOutput())
正如你所看到的,这不是真正多大用处的。
我需要的是关于所有时间都花在哪里的详细信息,我在这里错过了什么?
是'report.generateOutput()'用C或一个代码*巨型* 2k行没有任何进一步的电话? – delnan 2011-02-24 17:11:53
使用'hotshot'分析器代替 – 2011-02-24 17:14:02
report.generateOutput()仅仅是Python的大约200行,使用cStringIO – 2011-02-24 17:15:37