Home > Backend Development > PHP Tutorial > PHP program running performance analysis (graphics and text)

PHP program running performance analysis (graphics and text)

不言
Release: 2023-04-05 18:42:01
forward
3550 people have browsed it

The content of this article is about PHP program running performance analysis (pictures and texts). It has certain reference value. Friends in need can refer to it. I hope it will be helpful to you. .

After using xdebug, php can configure xdebug related configurations and generate running logs.

Configure in php.ini:

  1. xdebug.profiler_enable = 1
  2. xdebug.profiler_enable_trigger = 1
  3. xdebug.profiler_output_name = cachegrind. out.%t.%p
  4. xdebug.profiler_output_dir ="d:/xdebug/"

In this way, the log file will be generated to the d:/xdebug/ directory:

PHP program running performance analysis (graphics and text)

Every time php is executed, a corresponding log file will be generated. There used to be a tool called WinCacheGrind that could be used to analyze this kind of log, but WinCacheGrind was no longer maintained in 2015. The latest version is 1.0.0.14, which only supports xdebug2. When you open the log file, an error will be reported: "Cannot find target ".

In fact, the powerful phpstorm comes with the function of performance log analysis. Open Tools->Analyze Xdebug Profiler Snapshot..

PHP program running performance analysis (graphics and text)

and then select D: After opening the log file under \xdebug, you can see the tree relationship of function calls and the execution time of each function

PHP program running performance analysis (graphics and text)

In this way, you can find out which one Function execution is time-consuming.

【Related recommendations: PHP video tutorial

The above is the detailed content of PHP program running performance analysis (graphics and text). For more information, please follow other related articles on the PHP Chinese website!

Related labels:
php
source:cnblogs.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template