photo credit: Radar Gun on a Lincoln off-speed pitch. via photopin (license)

How to setup the profiler in Magento

Magento comes with a small built-in profiling tool. Although it’s not much, it could aid you when you’re trying to find the bottlenecks in your code. To enable the profiler, navigate to the system configuration > advanced > developer, and set ‘Profiler’ to ‘Yes’ in the debug section:

Screen Shot 2015-03-24 at 15.06.07
The second thing you need to do, is edit the index.php-file and uncomment the line that enables the profiler. You can find this command around line 71:

If you also want to know how many SQL-queries are executed and which of those queries is the slowest one, edit your app/etc/local.xml -file and add the following line to global/resources/default_setup:

Now you’re profiling the execution time of your code, the memory usage and the SQL queries.

How would you rate this article?

Leave a Reply