Home >Backend Development >PHP Tutorial >PHP program performance analysis tool

PHP program performance analysis tool

巴扎黑
巴扎黑Original
2016-11-12 15:09:281774browse

When developing some functional modules with relatively high efficiency requirements, it is often necessary to analyze the running bottlenecks of the program. Use the following tool to easily view the PHP script execution process. The following are the configuration steps:

1. PHP installation -debug-non-zts-20100525/xdebug.so

xdebug.profiler_output_dir="/mnt/hgfs/web/log/xdebug"

xdebug.profiler_output_name = "cachegrind.out.%t-%s"

xdebug.remote_autostart = On

mote_handler="dbgp"

xdebug .remote_mode=req

After this configuration, the performance debugging file will not be generated when the php program is executed normally. The debugging file will be generated only by adding the url parameter XDEBUG_PROFILE=1 to the suffix of the url. The debug file is in the path configured by the xdebug.profiler_output_dir parameter.

2. Install the tool qcachegrind to parse the debugging file

Download address: http://sourceforge.net/projects/qcachegrindwin/

Open qcachegrind, select the debugging file generated previously to open it and view it.

Actually, there are several tools of this type. This one is the one I have used and found to be more straightforward.

Statement:
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
Previous article:php curl displayNext article:php curl display