How to optimise Magento - Paul Meștereagă
Programming

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.

author

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.

Is your Magento slow?

Wondered how you can make your Magento load faster? Wonder no more. Here is a FREE step by step guide that helps you.

Related Posts

How to create a product attribute using Data Patches in Magento 2.3

How to create a product attribute using Data Patches in Magento 2.3

26 Mar 2020

|

Paul Mestereaga

This is a short tutorial in which we will learn to create a product attribute using Data Patches in Magento 2.3

Declarative schema in Magento 2.3+

Declarative schema in Magento 2.3+

16 Mar 2020

|

Paul Mestereaga

In this tutorial we will learn the how to configure a declarative schema in Magento 2.3, perform database operations using declarative schema, create a schema whitelist and create data and schema patches.

optimize-magento-preview

FREE!

Magento 2
Optimization guide

Wondered how you can make your Magento load faster? Wonder no more. Here is a step by step guide that helps you.