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
280
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
Mengukur dan meningkatkan performa website
mazipan
1
150
Testing JavaScript
mazipan
0
110
Membuat Website Zaman Sekarang
mazipan
0
380
Kinerja Web 101 - Edisi 2022
mazipan
1
310
Bagaimana implementasi mockup design
mazipan
0
320
Memulai karir sebagai web programmer
mazipan
0
590
Membuat laporan kecepatan web untuk blog
mazipan
0
390
Bongkar Dapur Webnya #PHPID-OL
mazipan
0
370
Menjadi web developer di masa pandemi
mazipan
0
440
Other Decks in Programming
See All in Programming
From Spring Boot 2 to Spring Boot 3 with Java 21 and Jakarta EE
ivargrimstad
0
1.1k
せっかくモデル図描くのなら、嬉しいことが多い方がいいよね!
kuboaki
1
3.1k
単体テストを書かない技術 #phpcon_odawara
o0h
PRO
25
7.8k
Ruby Function Composition
bkuhlmann
1
330
両面どころかインフラもTSでできるよ ~ 全方位TypeScriptによるプロダクト開発 ~
myfinder
9
3.2k
App Router への移行は「改善」となり得るのか?/ Can migration to App Router be an improvement
takefumiyoshii
8
2.1k
Site Reliability Engineering for GMO
pyama86
6
910
元気予報
suu_mire0726
0
850
脱・初心者!脱・マネコン!AWS CDKを使ってみませんか!?
har1101
0
300
"config" ってなんだ? / What is "config"?
okashoi
0
210
#phpcon_odawara オープン・クローズドなテストフィクスチャを求めて / open closed test fixtures
77web
3
210
Build with AI 2024 Seoul - 제로부터 시작하는 Flutter with Gemini 생활 - 박제창
itsmedreamwalker
0
200
Featured
See All Featured
The Brand Is Dead. Long Live the Brand.
mthomps
48
28k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
39
4.4k
Being A Developer After 40
akosma
56
580k
A Philosophy of Restraint
colly
196
16k
Rails Girls Zürich Keynote
gr2m
91
13k
Testing 201, or: Great Expectations
jmmastey
27
6.3k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
60
14k
Scaling GitHub
holman
457
140k
Documentation Writing (for coders)
carmenintech
59
3.9k
Building Effective Engineering Teams - LeadDev
addyosmani
27
1.8k
Adopting Sorbet at Scale
ufuk
67
8.6k
The Mythical Team-Month
searls
215
42k
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.