加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 大数据 > 正文

perl – 如何阅读NYTProf html报告?

发布时间:2020-12-15 23:20:42 所属栏目:大数据 来源:网络整理
导读:我对nytprofhtml生成的Devel :: NYTProf报告感到困惑.我使用旧版NYTProf 1.90.我知道这是一个非常古老的版本,但应该出于多种原因使用它. 所以这些HTML报告看起来很像 像这样(当查看特定的* .pl文件报告时): |Line|Stmts.| Time | Avg. |Code||42 | 6804 | 0
我对nytprofhtml生成的Devel :: NYTProf报告感到困惑.我使用旧版NYTProf 1.90.我知道这是一个非常古老的版本,但应该出于多种原因使用它.

所以这些HTML报告看起来很像
像这样(当查看特定的* .pl文件报告时):

|Line|Stmts.|   Time   |  Avg. |Code|
|42  | 6804 | 0.04506  | 7e-06 | }; |

我从未见过新版本的nytprofhtml的报告,所以不确定它们是否看起来一样.

在我的情况下,这一行是整个程序中最慢的部分(它不是一个小程序).
所以我的问题是如何声明这样’};’在程序中最慢的部分有更复杂的语句.我认为误解了NYTProf的报道.

如果我的问题令人困惑,请告诉我这些报告中每列的定义,这会有所帮助吗?这将有很大帮助.

特别是我对Stmts很感兴趣.意思.我猜,但我不想猜!

提前致谢.

解决方法

撑条.是执行语句的次数,或者更准确地说,是执行从与该行关联的语句(即 not always accurate)移动到下一个执行的语句的次数.

时间是执行与该行关联的语句所花费的时间的总和.

平均.只是时间除以Stmts.

current Devel::NYTProf documentation的这些摘录可能有助于:

The statement profiler measures the time between entering one perl statement and entering the next. Whenever execution reaches a new statement,the time since entering the previous statement is calculated and added to the time associated with the line of the source file that the previous statement starts on. […]

例如,给定:

while (<>) {
    ...
    1;
}

After the first time around the loop,any further time spent evaluating the condition (waiting for input in this example) would be recorded as having been spent on the last statement executed in the loop.

NYTProf的更新版本(其中有很多版本)通过拦截适当的内部循环操作码以及many other significant improvements为这种情况提供了更准确的时序.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读