"I wasted a day on CSS selector performance to make a website load 2ms faster" by @trys https://www.trysmudford.com/blog/i-spent-a-day-making-the-website-go-2ms-faster/
-
"I wasted a day on CSS selector performance to make a website load 2ms faster" by @trys https://www.trysmudford.com/blog/i-spent-a-day-making-the-website-go-2ms-faster/
This is one of the unfortunate things about the DevTools' "selector stats." It can really mislead you if you don't notice the text "(slow)" which _really_ means slow.
-
Another issue I've noticed with "selector stats" is that it might give the impression that selector perf is all that matters for reducing style calculation costs. Whereas if your costs are due to CSS custom properties, or excessive numbers of stylesheets (e.g. this fun issue [1]), or something else during style recalc, you can end up chasing ghosts.
(That said, I *love* selector stats, and it has helped me debug some real perf issues! I am glad we have it!)
-
@nolan We have had discussions about how to improve this. Agree it's only evocative, rather than descriptive, today.