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');
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).
| File | Size | Date | Attached by | |||
|---|---|---|---|---|---|---|
| Profiling.php No description | 8.26 kB | 00:47, 19 Oct 2007 | RoyK | Actions | ||