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.
How would you rate this article?
★ ★ ★ ★ ★