NPE*_*NPE 22 python profile profiler profiling
我使用Python(v2.4)profile模块来分析numpy脚本,以下条目似乎占了大部分执行时间:
ncalls tottime percall cumtime percall filename:lineno(function)
256/1 0.000 0.000 7.710 7.710 <string>:1(?)
Run Code Online (Sandbox Code Playgroud)
不幸的是,它的外观让谷歌很难.
我该如何弄清楚这究竟是什么?
编辑分析器从shell运行,如下所示:python -m profile -s cumulative script.py
Jea*_*one 22
忽略这一行.它是如何实现探查器的工件.它没有告诉你任何有用的东西.查看它的"tottime"值:0.000."tottime"是执行"<string>:1(?)"所花费的时间,不包括执行它的子项所花费的时间.所以,这里没有时间."cumtime"和"percall"很大,因为它们包括在儿童中度过的时间.有关详细信息,请参阅http://docs.python.org/library/profile.html#cProfile.run.