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
m (Protected "Profiling PHP": Developer Docs Migration ([Edit=Allow only administrators] (indefinite)))
 
(33 intermediate revisions by 15 users not shown)
Line 1: Line 1:
PHP has two significant profilers...
{{Template:Migrated|newDocId=/docs/guides/profiling/}}
 
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].
 
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==
 
* [http://moodle.org/mod/forum/discuss.php?d=162045 Forum thread about profiling Moodle 2.0]
Xdebug articles:
* [http://www.xdebug.org/docs/profiler Profiling PHP Scripts] in Xdebug documentation
* [http://devzone.zend.com/article/2803-Introducing-xdebug Introducing xdebug]
XHProf articles:
* [https://docs.google.com/present/view?id=dcbkgbgf_45fbg3rnmk& Presentation about XHProf]
* [http://techportal.ibuildings.com/2009/12/01/profiling-with-xhprof/ Profiling with XHProf]
* [http://www.open.ac.uk/blogs/XHProf/?page_id=46 XHProf – Profiling and Reporting] from Moodle perspective written by [http://moodle.org/user/view.php?id=264538&course=5 James Brisland]
 
{{CategoryDeveloper}}

Latest revision as of 00:44, 22 May 2023

Important:

This content of this page has been updated and migrated to the new Moodle Developer Resources. The information contained on the page should no longer be seen up-to-date.

Why not view this page on the new site and help us to migrate more content to the new site!