This post is about how bad a third party Magento 2 extension can hurt your M2 site performance.
Long story short Wyomind Google Trusted Stores extension added 250ms (which is a lot) to not-FPC M2 time to first byte (TTFB) time.
A Client site where I discovered that performance bug - Dive Gear Express® - provided a feedback:
... good example of how seemingly benign extension had outsized impact. Also good lesson learned about failure to bake periodic performance benchmarks in to the development phase of our website, rather than having diagnose after the fact.
I will list the steps I took to identify the extension that slowed down Magento 2 site.
Disclaimer: the Wyomind plugin in question is encoded and I won't be sharing any code here to prevent copyright violation claims. Wyomind did send us a plain text version of one of the files and I managed to fix performance bug and keep Trusted Stores functionality. But I won't be sharing it here for obvious reasons.
How to solve big Magento 2 TTFB problem
If your M2 site seems slow there is only one way to debug it - benchmark and compare against the default Magento 2 installation:
- Download and install the empty M2 on the same server. Use the same version. Use Luma theme.
- Install Mirasvit M2 profiler to collect TTFB metrics. You can use out of the box M2 profiler but I find mirasvit extension to be better.
- Compare TTFB of the similar pages.
- Disable extensions on your live site one by one until you get the live TTFB value equal to or around the empty M2 one.
- If you disable all extensions but the live TTFB is still higher than the empty one then try switching back to Luma theme. If it does the trick then you know your custom theme has performance problems.
Do you have examples of bad Magento 2 extensions? Share them in comments!
If you find this post interesting do not hesitate to sign up for our newsletter and join the 654 people who receive Magento news, tips and tricks regularly.