Magento Optimisation

The speed of your Magento shop is very important. A slow and bulky website always takes your customers away. In this post will present a module that will help you start your Magento optimisation. I used this module very recently in a project and I will show you my optimisation results.

Install the module

The module I am talking about it’s called Magento Profiler by Ecocode and you can find it here. You will find there a complete installation and configuration guide. The module was tested with Magento 1.7, 1.8. and 1.9.

Find the bottlenecks

With this module installed you will be able to see the request/response parameters, memory usage, time, mysql requests, events, ajax calls, layout calls, models loaded etc.
What I like the most and it was very important for me is that it displays the raw MySql queries and stack traces to locate the origin in the code. More than that it detects the identical queries. Concentrate on the dynamic parts of your website that are not cached, those are mostly the parts that are slowing your website.

Look how many MySql queries do you have on the page, how many are identical and how can you compact those queries into one. One of the main things that most of the junior developers are doing as a bad practice is to use the load() method inside loops. Try to avoid that as much as you can. Load the whole collection with all that you need and then loop through it. Always keep in mind the time and space complexity.

Look how your layout is loaded and which are the template blocks that are the slowest, than look into that code. Look into the Model CRUD metrics where you can find insightful data such as load() calls into loops.

My latest optimisation project

I had done recently some Magento optimisation and here is the results I got for the MySql queries.

Homepage – before:

homepage - before

Homepage – after:

homepage - after

Catalog – before:

homepage - before

Catalog – after:

homepage - after

Prouct page – before:

product - before

Prouct page – after:

product - after

Let me know if this was helpful for you. Also you can find more on optimisation here. If you have other tips leave them in the comments section below.

285 0 comments

Related Stories