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
390
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
95
Mengukur dan meningkatkan performa website
mazipan
1
200
Testing JavaScript
mazipan
0
130
Membuat Website Zaman Sekarang
mazipan
0
480
Kinerja Web 101 - Edisi 2022
mazipan
1
440
Bagaimana implementasi mockup design
mazipan
0
470
Memulai karir sebagai web programmer
mazipan
0
720
Membuat laporan kecepatan web untuk blog
mazipan
0
510
Bongkar Dapur Webnya #PHPID-OL
mazipan
0
500
Other Decks in Programming
See All in Programming
Vibe Coding の話をしよう
schroneko
14
3.7k
Orleans + Sekiban + SignalR でリアルタイムWeb作ってみた
tomohisa
0
240
プロダクトエンジニアのしごと 〜 受託 × 高難度を乗り越えるOptium開発 〜
algoartis
0
190
監視 やばい
syossan27
12
10k
The New Developer Workflow: How AI Transforms Ideas into Code
danielsogl
0
110
マイコンでもRustのtestがしたい/KernelVM Kansai 11
tnishinaga
0
850
実践Webフロントパフォーマンスチューニング
cp20
45
10k
flutter_kaigi_mini_4.pdf
nobu74658
0
150
LRパーサーはいいぞ
ydah
6
1.2k
Jakarta EE Meets AI
ivargrimstad
0
850
The Implementations of Advanced LR Parser Algorithm
junk0612
3
1.4k
REALITY コマンド作成チュートリアル
nishiuriraku
0
120
Featured
See All Featured
How to train your dragon (web standard)
notwaldorf
91
6k
Build The Right Thing And Hit Your Dates
maggiecrowley
35
2.7k
Faster Mobile Websites
deanohume
306
31k
Fashionably flexible responsive web design (full day workshop)
malarkey
407
66k
KATA
mclloyd
29
14k
How GitHub (no longer) Works
holman
314
140k
Side Projects
sachag
453
42k
Fontdeck: Realign not Redesign
paulrobertlloyd
84
5.5k
YesSQL, Process and Tooling at Scale
rocio
172
14k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
29
9.5k
Designing Experiences People Love
moore
142
24k
Practical Orchestrator
shlominoach
187
11k
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.