Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Layout Repaint & The Lessons Learned
Search
Irfan Maulana
January 03, 2022
Programming
0
410
Layout Repaint & The Lessons Learned
The lessons learned from the real case we face related with layout repainting problem on the web
Irfan Maulana
January 03, 2022
Tweet
Share
More Decks by Irfan Maulana
See All by Irfan Maulana
Panduan untuk mempublikasikan kode ke publik
mazipan
0
110
Mengukur dan meningkatkan performa website
mazipan
1
210
Testing JavaScript
mazipan
0
140
Membuat Website Zaman Sekarang
mazipan
0
500
Kinerja Web 101 - Edisi 2022
mazipan
1
450
Bagaimana implementasi mockup design
mazipan
0
490
Memulai karir sebagai web programmer
mazipan
0
730
Membuat laporan kecepatan web untuk blog
mazipan
0
530
Bongkar Dapur Webnya #PHPID-OL
mazipan
0
510
Other Decks in Programming
See All in Programming
Bedrock AgentCore ObservabilityによるAIエージェントの運用
licux
8
560
大規模FlutterプロジェクトのCI実行時間を約8割削減した話
teamlab
PRO
0
450
Terraform やるなら公式スタイルガイドを読もう 〜重要項目 10選〜
hiyanger
11
2.8k
AI Ramen Fight
yusukebe
0
120
MySQL9でベクトルカラム登場!PHP×AWSでのAI/類似検索はこう変わる
suguruooki
1
280
Flutterと Vibe Coding で個人開発!
hyshu
1
230
Go製CLIツールをnpmで配布するには
syumai
2
1.1k
バイブコーディングの正体——AIエージェントはソフトウェア開発を変えるか?
stakaya
5
730
CIを整備してメンテナンスを生成AIに任せる
hazumirr
0
520
Strands Agents で実現する名刺解析アーキテクチャ
omiya0555
1
110
JetBrainsのAI機能の紹介 #jjug
yusuke
0
180
ソフトウェア設計とAI技術の活用
masuda220
PRO
25
7.3k
Featured
See All Featured
Why Our Code Smells
bkeepers
PRO
337
57k
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
7
790
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
18
1k
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
126
53k
Raft: Consensus for Rubyists
vanstee
140
7k
Producing Creativity
orderedlist
PRO
346
40k
The Invisible Side of Design
smashingmag
301
51k
BBQ
matthewcrist
89
9.8k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
46
7.5k
The Language of Interfaces
destraynor
158
25k
Speed Design
sergeychernyshev
32
1.1k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
34
6k
Transcript
Layout Repaint & The Lessons Learned Irfan Maulana Principal Engineer
Web Platform, Tokopedia Semarang
mazipan.space
Loading Performance Lighthouse CLS LCP Speed Index TTI TTFB
Runtime Performance DevTools FPS CPU Usage Main Thread GC
Pixel Pipeline
Visual Change Trigger (JS/CSS) Common pixel pipeline Style Calculation Layout
Paint Composite
How to debug?
Paint Flashing On Chrome DevTools
Timeline on Safari
Recommendation
Recommendations 1. Optimize JavaScript Execution 2. Reduce the Scope and
Complexity of Style Calculations 3. Avoid Large, Complex Layouts and Layout Thrashing 4. Simplify Paint Complexity and Reduce Paint Areas 5. Stick to Compositor-Only Properties and Manage Layer Count 6. Debounce Your Input Handlers
Lesson Learned
None
Unnecessary Rendering See: https://codesandbox.io/s/aloha-css-uyox7 Problems: - Box repainting on sliding
- Hello3 & Hello4 unnecessary repaint Hints: - Stacking context - will-change
Infinite hidden animation See: https://codepen.io/mazipan/details/gOGLpev Problems: - Skeleton loading for
hidden element triggering repaint Alternatives: - Remove skeleton loading, or - Only show before the element will showing
JS First Problems: - Countdown timer w JS approach will
always trigger repaint for every second Alternatives: - Use CSS/SVG transition w JS for only generating the initial state
50% * Reduce more than CPU usage *On idle state
None
ksana.in/learn-render-perf
ksana.in/udacity-render-perf
Key Takeaways 1. Stick to the compositor-only props 2. Double
check your Stacking Layer 3. Check the hidden element 4. CSS First 5. Measure periodically
Thank You.