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
420
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
120
Mengukur dan meningkatkan performa website
mazipan
1
220
Testing JavaScript
mazipan
0
150
Membuat Website Zaman Sekarang
mazipan
0
510
Kinerja Web 101 - Edisi 2022
mazipan
1
460
Bagaimana implementasi mockup design
mazipan
0
500
Memulai karir sebagai web programmer
mazipan
0
740
Membuat laporan kecepatan web untuk blog
mazipan
0
540
Bongkar Dapur Webnya #PHPID-OL
mazipan
0
520
Other Decks in Programming
See All in Programming
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
560
Go言語の特性を活かした公式MCP SDKの設計
hond0413
1
440
開発組織の戦略的な役割と 設計スキル向上の効果
masuda220
PRO
5
840
When Dependencies Fail: Building Antifragile Applications in a Fragile World
selcukusta
0
110
釣り地図SNSにおける有料機能の実装
nokonoko1203
0
190
One Enishi After Another
snoozer05
PRO
0
150
Android16 Migration Stories ~Building a Pattern for Android OS upgrades~
reoandroider
0
130
Writing Better Go: Lessons from 10 Code Reviews
konradreiche
3
5.7k
Foundation Modelsを実装日本語学習アプリを作ってみた!
hypebeans
1
120
ソフトウェア設計の実践的な考え方
masuda220
PRO
4
630
iOSでSVG画像を扱う
kishikawakatsumi
0
150
bootcamp2025_バックエンド研修_WebAPIサーバ作成.pdf
geniee_inc
0
120
Featured
See All Featured
A Tale of Four Properties
chriscoyier
161
23k
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
657
61k
4 Signs Your Business is Dying
shpigford
185
22k
A better future with KSS
kneath
239
18k
Become a Pro
speakerdeck
PRO
29
5.6k
Measuring & Analyzing Core Web Vitals
bluesmoon
9
630
GitHub's CSS Performance
jonrohan
1032
470k
How STYLIGHT went responsive
nonsquared
100
5.8k
Practical Orchestrator
shlominoach
190
11k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
253
22k
The Illustrated Children's Guide to Kubernetes
chrisshort
49
51k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
194
16k
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.