DEV Community

Piotr Grzywa
Piotr Grzywa

Posted on

Why it's always worth to optimize website performance

On one of meet.js Katowice (Poland) we had an interesting conversation about performance.

One of the participants asked:
"Should we always optimize the web performance of our websites?"

He stands for: not always, it depends on your target audience, their internet connection, and the devices that they use.
If you are sure that your Customers/Visitors are eg. IT guys that always will go to your website from MacBook Pro with an extra super-fast fiber optic internet connection, you don't need to.

As I can partially agree with this, there is always but :)

Let's start with, why I can agree.

Agree GIF

Optimizing web performance (especially js long task, TTFB, FID, INP) can be tricky, that means it's also expensive, often you need to dig very deep into your application, exchange some libraries, rewrite functions, or even change framework you use.

Sometimes business could not agree on spending time, resources, and money on optimizing things that will not bring profits (we are considering the situation from the example above, our target audience use fast internet + high-end devices and for this target, our website is loading super fast).

But ...

But GIF

Even in this case, we should care about stuff that is relatively easy to optimize, eg. don't load big images/movies or don't fetch unnecessary data (if you need 2 items from API and inside you need only 2 properties, don't fetch 100 items with all 300 properties that you will never use).

Why?

  1. Cost optimization
    As a company we are always happy when we can save some money, making our resources smaller will help us reduce the cost of storage. Also when we are using SSR (Server Side Rendering) js long tasks and memory leaks can lead to high memory and CPU consumption on the node server that is responsible for rendering our website and this also can generate high costs (especially if need to deal with a lot of traffic).

  2. Ecology
    Every KB of data sent over the internet, each ms of CPU time, hosting all those not optimized images, etc., all this uses energy and affects the climate of our planet.
    You can check your website carbon footprint on WebPageTest website, more info can be found on their blog
    Web Page Test Carbon Control or on https://www.websitecarbon.com/

  3. Good practices
    It's always good to do things "in the right way", if you will learn web performance good practices, in your next project (or company) this could be a key to success.

Let me know in the comments what is your opinion on this subject, always optimize, or maybe not?

Top comments (0)