4 ms·
As long as css remains "so fast it's free" then I'm mostly happy with that - I use css without thinking about optimisations, and I like it like that!
by Incipient 10mo ago
As long as css remains "so fast it's free" then I'm mostly happy with that - I use css without thinking about optimisations, and I like it like that!
- Sesse__ 10mo agoYou can certainly write slow CSS, and people do :-) JavaScript typically takes up more of the CPU time overall, though.
- cryptonym 10mo agoIt's not free at all. You can profile it with debug tools and find the most expensive selectors to refactor them. You can also write CSS animations that impacts performance/user experience, this can also be profiled. Sorry but if you use advanced feature and especially on a big DOM, you have to think about optimisations.
- mmis1000 10mo agoWell, you can actually write slow css if you make real deep nested flex container. And it's not even too rare. You can actually find such example in yhe wild. The spec of flex layout requires it to layout its child elements several times to compute actual layout. Make it deep and nested without proper constrains will results in n*n*n*n… layout computations and bring down the browser on resize.
- cluckindan 10mo agoIt’s not even that hard. Use flex for layout and you can instantly see how slow reflow becomes when resizing the window.