gpt4 book ai didi

Python配置文件模块: :1(?)

转载 作者:IT老高 更新时间:2023-10-28 20:41:25 25 4
gpt4 key购买 nike

我正在使用 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(?)

不幸的是,它的外观让 Google 很难。

我该如何弄清楚这到底是什么?

edit 探查器从 shell 运行如下: python -m profile -s 累积脚本.py

最佳答案

忽略此行。它是分析器如何实现的工件。它没有告诉你任何有用的东西。查看它的“tottime”值:0.000。 “tottime”是执行“ :1(?)”所花费的时间量,不包括执行它的子项所花费的时间。所以,没有时间花在这里。 “cumtime”和“percall”很大,因为它们包括在 child 身上花费的时间。见 http://docs.python.org/library/profile.html#cProfile.run了解更多详情。

关于Python配置文件模块: <string>:1(?),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5964126/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com