O'Reilly logo

Magento 2 Developer's Guide by Branko Ajzele

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required