The profiler
Magento
has an in-built profiler that can be used to identify performance problems on the server side. In a nutshell, the profiler can tell us the execution time of certain chunks of code. There is nothing that great with its behavior. We can only get the execution time of code blocks or individual expressions that have been wrapped by the profiler's start and stop methods. On its own, Magento
calls for the profiler extensively across its code. However, we can't see it in effect as the profiler output is disabled by default.
Magento
supports three profiler outputs, namely html
, csvfile
, and firebug
.
To enable the profiler, we can edit .htaccess
and add one of the following expressions:
SetEnv MAGE_PROFILER "html"
SetEnv MAGE_PROFILER "csvfile"
SetEnv MAGE_PROFILER "firebug"
The HTML type of profiler will show its output into the footer area of a page that we open in the browser, as shown in the following screenshot:
The csv
file type of profiler will output into var/log/profiler.csv...