Take rendering process to pieces for Web browser performance.
I try to take piece to process of rendering , then confirm what the browser do.
Especially, “Paint” process is high cost, so it is better to use “will-change” property.
Notice : Watch out for overuse!
of rendering , then confirm what the browser do. - Especially, “Paint” process is high cost, so it is better to use “will-change” property. - Notice : Watch out for overuse!
The engine draws structured text from a document (often HTML), and formats it properly based on the given style declarations (often given in CSS). https://developer.mozilla.org/en-US/docs/Glossary/Rendering_engine, Ұ෦มߋ
- CSSOM - Erase unused matching rules because they are referenced many times. - Descendant selector - Reduce. They consume CPU relatively. https://developers.google.com/web/fundamentals/performance/rendering
calculate exact position and size - Adjusting the influence from a element to some element (s). - High cost process - Maybe laggy. https://developers.google.com/web/fundamentals/performance/rendering
the synthesized pixel to the user’s screen. - text, color, border, shadow… - Paint process is high cost because this process is across multiple layers. https://developers.google.com/web/fundamentals/performance/rendering
when drawing to screen with graphics API. - Perform pixel embedding - Rasterization - Covert data to dot-sets https://developers.google.com/web/fundamentals/performance/rendering
- Draw on the screen in the correct order so that the page renders correctly. - We don't be conscious because the browser feels good. - That being said, controllable. https://developers.google.com/web/fundamentals/performance/rendering
element, such as width, height, left or top position. - Check all other elements and "reflow" the page. - Repaint affected areas across layers - Full process runs https://developers.google.com/web/fundamentals/performance/rendering
of Pixel pipeline affects. - Concrete example - cursor: Except EdgeHTML, about composition - If it is WebKit, nothing will be affected -> Low cost and light weight - float: affects all processes https://csstriggers.com/
combined by the browser, the entire screen needs to be repainted. - For example, pin a header at the top of the page (like global navigation) and draw something at the view bottom. - Eventually the entire screen is repainted. - I wish they was painted bottom area, it would be cheaper…
about what elements are expected to change - Browsers can set up optimizations before elements are actually changed. - The high-cost processing run potentially, page response can improve.
will be update soon. - To maintain certain optimizations for a long time. - We need to turn will-change on / off using script code before and after the change occurs.
function hintBrowser() { // They will be update at key frame block this.style.willChange = 'transform, opacity'; } function removeHint() { this.style.willChange = 'auto'; }
of rendering , then confirm what the browser do. - Especially, “Paint” process is high cost, so it is better to use “will-change” property. - Notice : Watch out for overuse!