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:

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:

1

Varien_Profiler::enable();

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:

1

<profiler><![CDATA[true]]></profiler>

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

This is the blog Giel Berkers,
a fulltime web developer from The Netherlands with a passion for the web.
I want to share ideas, knowledge, but also learn from
my readers. If you got any questions, or need help with something, feel free to drop me a
line.If I think that more people can benefit from the answer on your question, I'll write a blog post about it.