In optimizing the efficiency of PHP code execution, it is a good idea to use Xdebug to generate profile files, and then see where the bottleneck of the entire program is. Now there are several xdebug profile viewing procedures, listed here.
Wincachegrind
Wincachegrind is a profile viewer under Windows, and it feels good to use, and sometimes it crashes when profiles are too big.
Today on Gao Chunhui's blog, see these:
Recently began to take Xdebug and Wincachegrind to the project's PHP Code analysis and optimization, but found that the implementation time with their own output is always 10 times times the difference is not a fraction, but 10 times times.
Internet search for a moment, originally in the Xdebug 2.0.0RC4 version began, the profiler log in the time unit has been modified.
("useµseconds instead of a tenths ofµseconds to avoid confusion in profile information." ”)
and wincachegrind no longer upgrade maintenance, so the 2.0.0RC4 and later version of the Xdebug output Profiler log with the Wincachegrind to analyze, there will be 10 times times the gap between the time.
He has provided hack version, can solve the problem of time gap, interested students can try.
Cachegrindvisualizer
Cachegrindvisualizer is a xdebug profile file that looks at the client side and uses Adobe's air production.
A more detailed introduction can be seen in the previous written about Cachegrindvisualizer.
Kcachegrind
Kcachegrind is a graphical profile view tool under Linux and has a strong function.
Callgrind uses runtime instrumentation via the Valgrind framework for its cache simulation and call-graph generation. This way, even shared libraries and dynamically opened plugins can be profiled. The data files generated by Callgrind can is loaded into kcachegrind for browsing the performance results.
Webgrind
Webgrind and Wincachegrind are similar in functionality, but Webgrind is web-based and uses PHP-written viewing tools. Look at the code, running on the Linux server is better.
Webgrind is a Xdebug profiling Web Frontend in PHP5. It implements only a minimal subset of the features of Kcachegrind, but installs in seconds with and works on all platforms. For quick ' n ' dirty optimizations it does the job.
The following is a webgrind view of the phpMyAdmin profile capture: