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
92
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
430
Bagaimana implementasi mockup design
mazipan
0
460
Memulai karir sebagai web programmer
mazipan
0
710
Membuat laporan kecepatan web untuk blog
mazipan
0
510
Bongkar Dapur Webnya #PHPID-OL
mazipan
0
490
Other Decks in Programming
See All in Programming
Agentic Applications with Symfony
el_stoffel
2
310
RuboCop: Modularity and AST Insights
koic
2
1.4k
State of Namespace
tagomoris
4
1.8k
Bedrock×MCPで社内ブログ執筆文化を育てたい!
har1101
6
1k
これだけは知っておきたいクラス設計の基礎知識 version 2
masuda220
PRO
24
6.5k
一緒に働きたくなるプログラマの思想 #QiitaConference
mu_zaru
49
13k
Memory API : Patterns, Performance et Cas d'Utilisation
josepaumard
0
140
ComposeでWebアプリを作る技術
tbsten
0
110
サービスクラスのありがたみを発見したときの思い出 #phpcon_odawara
77web
4
680
Kamal 2 – Get Out of the Cloud
aleksandrov
1
190
Unlock the Potential of Swift Code Generation
rockname
0
260
Youtube Lofier - Chrome拡張開発
ninikoko
0
2.4k
Featured
See All Featured
Build The Right Thing And Hit Your Dates
maggiecrowley
35
2.6k
Unsuck your backbone
ammeep
670
57k
Visualization
eitanlees
146
16k
Why Our Code Smells
bkeepers
PRO
336
57k
Producing Creativity
orderedlist
PRO
344
40k
Speed Design
sergeychernyshev
29
900
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
104
19k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
31
1.1k
Building a Scalable Design System with Sketch
lauravandoore
462
33k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
45
9.5k
4 Signs Your Business is Dying
shpigford
183
22k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
41
2.2k
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.