Skip to content

Latest commit

 

History

History
107 lines (62 loc) · 5.08 KB

rendering.md

File metadata and controls

107 lines (62 loc) · 5.08 KB

CSS rendering performance in 5 points

CSS rendering performance is the efficiency to compute styles after everything is loaded. The purpose is to get fluid interfaces, for example fast scrolls or smooth animations. To do that we need to get the browser rendering the page at 60fps everywhere.

1. Is it important?

Yes it does.

2. What actually happens in the browser?

There’s no universal solution to improve render performance, it depends on your use-case. The best beginning is to understand the steps which the browser has to do to get pixels onto the screen.

Presentations and code examples to explain the concepts of re-layouts, re-paints, layers, composition, CPU and GPU.

Why it is cheaper for the browsers to animate a transformation than an element height.

3. CSS selectors performance

The possible performance gains from optimizing CSS selectors will be small, and are not worth the costs.

4. Tools

He wanted to create a tool that would allow developers to more readily understand the ramifications of changing their styles. And now it is the most important tool to have when dealing with CSS rendering performance issues.

5. Experience Feedback

GitHub had some pages with almost 30s of style recalculation (slide 19), because of particular conditions like 50k DOM elements (slide 63). In this hard context, they had to drastically simplify their HTML and CSS.

The most interesting point is that less than half of the people that touch the CSS (slide 101) are CSS developers (slide 102). So you have to have rules and tools to monitor your CSS, like the number of selectors.

Four Kitchens’ website had a big fixed background image that cause scrolling performance issues. This article show how they diagnose it and fixed it.

It is a typical use case that is certainly present in one of your projects.

An example from the AirBnB dashboard, with real metrics, show that blur-radius cost processing power.

Not referenced links

All this links talk about CSS rendering performances, but there are either out of date or redundant with the previous links: