𝗪𝗵𝗶𝗰𝗵 𝗠𝗮𝗴𝗲𝗻𝘁𝗼 𝗘𝘅𝘁𝗲𝗻𝘀𝗶𝗼𝗻 𝗜𝘀 𝗦𝗹𝗼𝘄𝗶𝗻𝗴 𝗬𝗼𝘂 𝗗𝗼𝘄𝗻?
Stop guessing.
A slow store often happens because of too many extensions. Most people disable them one by one to find the problem. This is not debugging. This is guessing on a live site.
Magento 2 lets you measure the cost of an extension. You need to look at four areas:
- Plugins: Every plugin adds a layer to a request. Many plugins on fast paths create slow requests.
- Observers: An observer on a common event runs on every page.
- Layout: Modules inject blocks into shared containers. These run even when you do not need them.
- Queries: One extra lookup per item can create hundreds of extra queries on a single page.
Do not guess. Use the built-in profiler to find the truth.
Run this command: bin/magento dev:profiler:enable
Load a slow page. Look for methods called too many times. A method called 1,400 times is a problem.
For better data, use Blackfire, Xdebug, or New Relic. Blackfire shows you exactly how much time a vendor namespace uses.
You can also find where modules hook in by searching your files:
To find plugins: grep -rl "<plugin" vendor//module-/etc/ app/code///etc/
To find observers: grep -rl "<observer" vendor//module-/etc/ app/code///etc/
Once you find a suspect, use the scientific method:
- Measure the page speed with the module active.
- Disable that specific module.
- Measure the page speed again.
The difference is the real cost of that module.
When you find a slow module, you have three choices:
- Change the scope: Use di.xml to limit the plugin to specific areas.
- Replace the logic: Write your own thin module to replace a heavy around plugin.
- Remove it: If the cost is higher than the value, delete it.
Stop treating performance like folklore. Use data to fix your store.
Source: https://dev.to/iamrobindhiman/which-magento-extension-is-slowing-you-down-stop-guessing-1mj3