PHP Profiler¶
A profiler is an application that helps track execution performances, and spots slow parts of the application for optimization.
PHP has several profilers. They may provide an online interface to visualize the results, or a local server, or even a raw execution breakdown, which may then be processed to identify the bottlenecks.
<?php
// code to use with PHP-spx, one of PHP profilers
while ($task = get_next_ready_task()) {
spx_profiler_start();
try {
$task->process();
} finally {
spx_profiler_stop();
}
}
?>
See also BlackFire, PHP-profiler, PHP-reli, XHprof and Xdebug.
Related : Debugger, Bottleneck, Flame Graph, Micro-optimisation