zoukankan      html  css  js  c++  java
  • PHP性能分析工具xdebug+qcachegrind

    先安装xdebug工具

    pecl install xdebug

    修改php.ini配置

    [xdebug] zend_extension="xdebug.so"

    # profiler功能的开关,默认值0,如果设为1,则每次请求都会生成一个性能报告文件。

    # xdebug.profiler_enable=0

    # 默认值是0,如果设为1 则当我们的请求中包含 XDEBUG_PROFILE 参数时才会生成性能报告文件

    xdebug.profiler_enable_trigger=1

    # 分析文件保存目录, 默认是 /var/tmp xdebug.profiler_output_dir="/var/tmp/xdebug"

    请求参数加上XDEBUG_PROFILE才会生成分析文件, 会生成在这里 /var/tmp/xdebug

    http://127.0.0.1/phpinfo.php?XDEBUG_PROFILE

    安装qcachegrind 

    brew install qcachegrind --with-graphviz

    在命令行里使用 qcachegrind 打开它,然后通过它打开要分析的文件

    也可以在命令后直接跟要分析的文件

    qcachegrind

    /var/tmp/xdebug/cachegrind.out.38595

    参考: http://yzone.net/blog/151 https://stackoverflow.com/questions/4473185/do-you-have-kcachegrind-like-profiling-tools-for-mac http://stackoverflow.org.cn/front/ask/view?ask_id=340042

  • 相关阅读:
    hashCode花式卖萌
    2017年的小总结
    多线程环境下的单例模式
    Servlet过滤器简单探索
    最长回文子序列(LPS)
    最短编辑距离问题
    赫夫曼编码
    DNA序列对齐问题
    同时寻找序列的最大最小值
    最长公共子序列(LCS)
  • 原文地址:https://www.cnblogs.com/derrck/p/9150412.html
Copyright © 2011-2022 走看看