Note:

If you want to create a new page for developers, you should create it on the Moodle Developer Resource site.

Profiling PHP: Difference between revisions

From MoodleDocs
No edit summary
No edit summary
Line 1: Line 1:
{{stub}}
PHP has two significant profilers...


One is [http://www.xdebug.org/docs/profiler XDebug] - this is well known and understood and it's trace output is supported by tools like [http://kcachegrind.sourceforge.net/html/Home.html KCachegrind].


Suggestion, please look into xhprof (I saw the following talk about it: https://docs.google.com/present/view?id=dcbkgbgf_45fbg3rnmk&)
The other is [http://pecl.php.net/package/xhprof xhprof], a profiler released by facebook's engineering team, designed for capturing profile traces on live servers. Compared to XDebug, xhprof aims to have the minimum impact on execution times and require relatively little space to store a trace, so you can run it live without a noticeable impact on users and without filling disks. The trade off with xhprof is in ''slightly'' less detail and a trace format that needs it's own GUI to visualize (which ships with xhprof). The reason you'd want to profile in a live environments (vs. on development) is certain categories of problem may only been seen live, e.g. (data related) what happens when the user table grows 100 times, the impact on "login.php"  or (service related) server to server HTTP requests. Did a presentation once [https://docs.google.com/present/view?id=dcbkgbgf_45fbg3rnmk XHProf - facebooks PHP profiler] which explains in more detail - Penny saw the talk which is how I ended up writing this.


==See also==
==See also==

Revision as of 20:24, 10 November 2010

PHP has two significant profilers...

One is XDebug - this is well known and understood and it's trace output is supported by tools like KCachegrind.

The other is xhprof, a profiler released by facebook's engineering team, designed for capturing profile traces on live servers. Compared to XDebug, xhprof aims to have the minimum impact on execution times and require relatively little space to store a trace, so you can run it live without a noticeable impact on users and without filling disks. The trade off with xhprof is in slightly less detail and a trace format that needs it's own GUI to visualize (which ships with xhprof). The reason you'd want to profile in a live environments (vs. on development) is certain categories of problem may only been seen live, e.g. (data related) what happens when the user table grows 100 times, the impact on "login.php" or (service related) server to server HTTP requests. Did a presentation once XHProf - facebooks PHP profiler which explains in more detail - Penny saw the talk which is how I ended up writing this.

See also

Template:CategoryDeveloper