User:RoyK > Profiling

Profiling

Profiling PHP code

Add Profiling.php into your /includes/ folder. In LocalSettings.php, add:

$wgProfiling = true;
$wgDebugLogFile = 'debug.txt';

 Then load any page in your wiki; debug.txt will then be populated with load times between breakpoints. To set breakpoints, add:

wfProfileIn('name-profiled-code');
... CODE ... 
wfProfileOut('name-profiled-code');

Profiling API times from PHP

You can also profile all the API calls by setting:

$wgProfileApi = true;

This will create a list of all the API calls and their execution time; you'll have to do a "View HTML Source" in your browser to see the times. There are two times reported: Total and Real. Real time is simply the time for all unique queries (this indicates a PHP inefficiency as it is making many of the same calls over).

Tag page

Files 1

FileSizeDateAttached by 
 Profiling.php
No description
8.26 kB00:47, 19 Oct 2007RoyKActions
You must login to post a comment.
Powered by MindTouch Deki v.8.08.1a