什么是“<周期1>”? Xdebug 中的指示?周期1>
我在使用 kcachegrind 解析的 php 脚本上有一个 xdebug 配置文件。下面的屏幕截图显示,在任何给定函数中花费的最多时间都花在
内,并且顶部的“调用者”由 index.php 中的“include”和“include_once”组成。
此配置文件是在使用 apache 'ab' 进行压力测试期间运行的,因此有许多并发连接发生。
xdebug 配置文件上的
表示什么?
I have an xdebug profile on a php script that I parsed with kcachegrind. Here is a screenshot showing that the most time spent inside any given function was spent inside <cycle 1>
and the top 'Callers' were made from 'include' and 'include_once' in index.php.
This profile was run during a stress-test using apache 'ab' so there were many concurrent connections occurring.
What does <cycle 1>
indicate on an xdebug profile?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这是启发式循环检测。您可以从工具栏或菜单“查看->检测周期”或“查看->执行周期检测”将其关闭。
循环类似于递归,既可以是直接的(
f() -> f() -> f()
其中->
表示调用),也可以是间接的(f()->g()->f()->g()->f()
)Callgring 格式(在 kcachegrind 中使用)不保存完整的调用堆栈,它只存储对调用者-被调用者,可能很难从这些信息中恢复更长的周期
It is heuristic cycle detection. You can turn it off from toolbar or from menu "View->Detect cycles" or "View->Do cycle detection".
Cycle is something like recursion, both direct (
f() -> f() -> f()
where->
means call ) and indirect (f()->g()->f()->g()->f()
)Callgring format (used in kcachegrind) is not saving full call stack, it stores only pairs caller-callee and it may be hard to restore longer cycles from this information
虽然@osgx提到您可以关闭循环检测,但我只是想在这里指出,如果您觉得
隐藏了您感兴趣的东西,您可能应该关闭周期检测,正如他所解释的那样。在我的例子中禁用循环检测实际上揭示了一些之前丢失的关键信息。
Although @osgx mentions that you can turn off Cycle Detection, I just wanted to point out here that if you feel that
<cycle 1>
is hiding something of interest to you, that you probably should turn off cycle detection as he explains.Disabling cycle detection in my case actually revealed some key pieces of information that were missing before.