Hierarchical Profiler

Giriş

XHProf is a light-weight hierarchical and instrumentation based profiler. During the data collection phase, it keeps track of call counts and inclusive metrics for arcs in the dynamic callgraph of a program. It computes exclusive metrics in the reporting/post processing phase, such as wall (elapsed) time, CPU time and memory usage. A functions profile can be broken down by callers or callees. XHProf handles recursive functions by detecting cycles in the callgraph at data collection time itself and avoiding the cycles by giving unique depth qualified names for the recursive invocations.

XHProf includes a simple HTML based user interface (written in PHP). The browser based UI for viewing profiler results makes it easy to view results or to share results with peers. A callgraph image view is also supported.

XHProf reports can often be helpful in understanding the structure of the code being executed. The hierarchical nature of the reports can be used to determine, for example, what chain of calls led to a particular function getting called.

XHProf supports ability to compare two runs (a.k.a. "diff" reports) or aggregate data from multiple runs. Diff and aggregate reports, much like single run reports, offer "flat" as well as "hierarchical" views of the profile.

Additional documentation can be found via the » facebook xhprof website.

add a note

User Contributed Notes 4 notes

up
19
Thanh Tung
5 years ago
This extension is still maintained. It support PHP up to version 7.4. You can find it in the PECL repository: https://pecl.php.net/package/xhprof
up
17
troffed
7 years ago
A profiler based on XHProf but for PHP7+ can be found at https://github.com/tideways/php-xhprof-extension
up
3
Ayoub Hadran
1 year ago
This extension is still maintained for PHP 8. You can find the latest fork at https://github.com/longxinH/xhprof
To Top