Do you have slow page load times? Are you developing a plugin and suddenly it’s making your site run VERY slow?
In order to address performance issues within your code, you can use an out of the box solution provided by Magento. It is the Varien Profiler. It basically monitors the time and memory allocation of your application loading cycle at specific intervals you set. It’s also very easy to use.
//First, enable the profiler
//Second, start the profiler with a special key
//do some php code
//next, stop your profiler with the same key
//Last, disable your profiler
Now you’ve captured how long it’s taken to execute your code.
But where do you see it?
In order to do that, you have to go into your Magento admin panel and go to System->Configuration->Advanced->Developer. Go to the Debug tab and enable the profiler.
Click save, refresh the cache and go to your frontend. Load a page and scroll to the bottom. You should see something new.
Its an output of your profile you just ran.
Also, if you want to profile your whole application and see where there are bottlenecks, simply go into your index.php file and uncomment the following line:
Just don’t forget to comment it out again once you are done!
Now you will be able to check and see any bottlenecks or resource hogs in your application.
I hope this helps.
Until next time.