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
360
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
51
Mengukur dan meningkatkan performa website
mazipan
1
180
Testing JavaScript
mazipan
0
120
Membuat Website Zaman Sekarang
mazipan
0
440
Kinerja Web 101 - Edisi 2022
mazipan
1
400
Bagaimana implementasi mockup design
mazipan
0
420
Memulai karir sebagai web programmer
mazipan
0
680
Membuat laporan kecepatan web untuk blog
mazipan
0
480
Bongkar Dapur Webnya #PHPID-OL
mazipan
0
460
Other Decks in Programming
See All in Programming
useSyncExternalStoreを使いまくる
ssssota
6
1k
testcontainers のススメ
sgash708
1
120
선언형 UI에서의 상태관리
l2hyunwoo
0
160
KubeCon + CloudNativeCon NA 2024 Overviewat Kubernetes Meetup Tokyo #68 / amsy810_k8sjp68
masayaaoyama
0
250
これでLambdaが不要に?!Step FunctionsのJSONata対応について
iwatatomoya
2
3.7k
競技プログラミングへのお誘い@阪大BOOSTセミナー
kotamanegi
0
360
快速入門可觀測性
blueswen
0
360
暇に任せてProxmoxコンソール 作ってみました
karugamo
2
720
20年もののレガシープロダクトに 0からPHPStanを入れるまで / phpcon2024
hirobe1999
0
480
Security_for_introducing_eBPF
kentatada
0
110
rails stats で紐解く ANDPAD のイマを支える技術たち
andpad
1
290
Recoilを剥がしている話
kirik
5
6.7k
Featured
See All Featured
YesSQL, Process and Tooling at Scale
rocio
169
14k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
32
2.7k
Gamification - CAS2011
davidbonilla
80
5.1k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
247
1.3M
Mobile First: as difficult as doing things right
swwweet
222
9k
Automating Front-end Workflow
addyosmani
1366
200k
What's in a price? How to price your products and services
michaelherold
243
12k
Fantastic passwords and where to find them - at NoRuKo
philnash
50
2.9k
RailsConf 2023
tenderlove
29
940
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
191
16k
The World Runs on Bad Software
bkeepers
PRO
65
11k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
132
33k
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.