Modern Tribe Quick Profiler
A tool to easily and rapidly profile WordPress load time and memory usage with an extremely low overhead.
- Place this file in your wp-content/mu-plugins folder (create the folder if it doesn’t already exist.)
- Add the following definitions to your wp-config.php file with desired settings.
- View your site and watch the logs to see what’s slow.
This determines the odds that this plugin will run. Set this very low if you are testing on a high traffic site. Or set it to ‘1’ if you want every page load to be profiled.
Time Threshold (milliseconds)
Determine the minimum amount of time increase that should trigger logging in ms. If the time spent between filters exceeds this amount, it will be logged.
Memory Threshold (kilobytes)
Determine the minimum amount of memory increase that should trigger logging in kB. If the memory consumed between filters exceeds this amount, it will be logged.
If this is not set, then logging will be directed to the standard php error log. If set to ‘1’, then logging will be directed to wp-content/tribe_profile.log. If set to a full path, then logging will be directed to the specified file.
- Perhaps we should dump the results on shutdown and build a profiling viewer.
- This plugin does not currently assess cumulative effects. The cumulative effect of running a single hook 10000 times could be useful.
- It might be useful to add a log cycling function so that we avoid massive log files.
- Sometimes memory actually drops substantially. Is it worth logging that too?