Hacker News new | ask | show | jobs
by BurningFrog 2562 days ago
But does bloated CSS matter?

If a human isn't going to read the CSS and the computer handles it without performance problem, I say no.

Those are of course two quite important ifs!

3 comments

It matters.

First, not all users need your huge CSS file, in terms of downloading. Specially when they're on mobile phones and cache is crap.

A ~9000 rules CSS file will load and become COSSM slower than one that has 1000 or 10. It is linear increment. Make a test to see it for yourself.

A bloated CSS is more network time. Therefore, slower loading.

A bloated CSS will contain slower selectors, therefore slower rendering time and painting speed.

When you count all these things, you will see radical speed performance.

Maybe. You need to measure these things and get a feel for the actual performance impact to make informed decisions.

Rule 1 of performance: Your intuitions are not reliable.

Upthread, this commenter did post specific measurements from production projects.
Does download size matter? Why bother with compression or minification?

https://jakearchibald.com/2019/f1-perf/

No. No way. If you're CSS is a problem - then you are doing something really really wrong.