How to optimise Magento

The speed of your Magento shop is very important. A slow and bulky website always takes your customers away. Magento optimisation, here is a way to do it.

Paul Mestereaga

January 18, 2017

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.

Related Posts

Extend Magento 2 jQuery Widget

18 Jun 2019


Paul Mestereaga

In this short tutorial we will learn how to extend Magento 2 jQuery widget with our custom logic.

Console Commands in Magento 2

21 May 2019


Paul Mestereaga

In this tutorial I will give an overview of the console commands in Magento 2 and we will learn how to build a custom console command in Magento 2

Optimize Magento 2

Free guide to help you optimise your Magento 2 installation and improve your website speed

Get your free optimisation guide.

Enter your name and email to join my mailing list in exchange for the free download. You can opt out any time.

Can I email you?

I will use the information you provide on this form to stay in touch, send you updates, and send marketing emails about our products and services. You can unsubscribe at any time through a link in the footer of an email from me. For more information, please read the Privacy Policy.