<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/refs.basic.php.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'zh',
  ),
  'this' => 
  array (
    0 => 'book.xhprof.php',
    1 => 'Xhprof',
    2 => '层次式性能分析器',
  ),
  'up' => 
  array (
    0 => 'refs.basic.php.php',
    1 => '影响 PHP 行为的扩展',
  ),
  'prev' => 
  array (
    0 => 'wincache.win32build.verify.php',
    1 => 'Verifying the build',
  ),
  'next' => 
  array (
    0 => 'xhprof.setup.php',
    1 => '安装/配置',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'zh',
    'path' => 'reference/xhprof/book.xml',
  ),
  'history' => 
  array (
  ),
  'extra_header_links' => 
  array (
    'rel' => 'alternate',
    'href' => '/manual/en/feeds/book.xhprof.atom',
    'type' => 'application/atom+xml',
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="book.xhprof" class="book">
 
 <h1 class="title">层次式性能分析器</h1>
 

 <div id="intro.xhprof" class="preface">
  <h1 class="title">简介</h1>
  <p class="para"> 
   XHProf 是一个轻量级的分层性能测量分析器。
   在数据收集阶段，它跟踪调用次数与测量数据，展示程序动态调用的弧线图。 
   它在报告、后期处理阶段计算了独占的性能度量，例如运行经过的时间、CPU 计算时间和内存开销。
   函数性能报告可以由调用者和被调用者终止。
   在数据搜集阶段 XHProf 通过调用图的循环来检测递归函数，通过赋予唯一的深度名称来避免递归调用的循环。
  </p>
  <p class="para">
   XHProf 包含了一个基于 HTML 的简单用户界面(由 PHP 写成)。
   基于浏览器的用户界面使得浏览、分享性能数据结果更加简单方便。
   同时也支持查看调用图。
  </p>
  <p class="para">
   XHProf 的报告对理解代码执行结构常常很有帮助。
   比如此分层报告可用于确定在哪个调用链里调用了某个函数。
  </p>
  <p class="para">
   XHProf 对两次运行进行比较（又名 &quot;diff&quot; 报告），或者多次运行数据的合计。
   对比、合并报告，很像针对单次运行的“平式视图”性能报告，就像“分层式视图”的性能报告。
  </p>
  <p class="para">
   更多额外文档可以在
   <a href="http://web.archive.org/web/20110514095512/http://mirror.facebook.net/facebook/xhprof/doc.html" class="link external">&raquo;&nbsp;facebook xhprof</a> 上找到。
  </p>
 </div>

 








 







 








 









<ul class="chunklist chunklist_book"><li><a href="xhprof.setup.php">安装/配置</a><ul class="chunklist chunklist_book chunklist_children"><li><a href="xhprof.requirements.php">需求</a></li><li><a href="xhprof.installation.php">安装</a></li><li><a href="xhprof.configuration.php">运行时配置</a></li></ul></li><li><a href="xhprof.constants.php">预定义常量</a></li><li><a href="xhprof.examples.php">示例</a></li><li><a href="ref.xhprof.php">Xhprof 函数</a><ul class="chunklist chunklist_book chunklist_children"><li><a href="function.xhprof-disable.php">xhprof_disable</a> — 停止 xhprof 分析器</li><li><a href="function.xhprof-enable.php">xhprof_enable</a> — 启动 xhprof 性能分析器</li><li><a href="function.xhprof-sample-disable.php">xhprof_sample_disable</a> — 停止 xhprof 性能采样分析器</li><li><a href="function.xhprof-sample-enable.php">xhprof_sample_enable</a> — 以采样模式启动 XHProf 性能分析</li></ul></li></ul></div><?php manual_footer($setup); ?>