• notice
  • Congratulations on the launch of the Sought Tech site

Xdebug combined with webgrind to perform performance analysis of the program

    Xdebug is an open source PHP program debugger, its function is not only The original plain text error display has become a color error display, and there is a real performance analysis.

The first step: install xdebug, add configuration in php.ini:

zend_extension < span class="pun">= "E:/Lnmp/Bin/PHP/php-5.6.20-nts- x64/ext/php_xdebug.dll" xdebug.auto_trace = on xdebug< The webgrind page (at this time, the file cachegrind.out.1469501363.6056.webgrind will be generated in the tmp directory).Select the file to be analyzed, and click update to perform the analysis as shown in the figure below (the red box in the figure is the place to read the configuration value): 

xdebug combined with webgrind to analyze the performance of the program

Result Significance:

1, look at the color bar in the upper right corner and the color point on the left in the list are corresponding, the upper right corner is the total time statistics of each color, the list is the breakdown time Statistics.Among them, green represents the call to the class; orange represents other process calls; blue represents the php built-in function, and gray represents the time required for the inclusion of the require/include file.

2, invocation count is the total number of times the function is called after the php page is executed; total self cost is the time consumed by the function itself; total inclusive cost is the total cost of the function from the beginning to the completion of the execution Time.

3, you can click on each call to view more detailed call times and call time statistics.


Technical otaku

Sought technology together

Related Topic


Leave a Reply