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
130
Mengukur dan meningkatkan performa website
mazipan
1
230
Testing JavaScript
mazipan
0
160
Membuat Website Zaman Sekarang
mazipan
0
510
Kinerja Web 101 - Edisi 2022
mazipan
1
470
Bagaimana implementasi mockup design
mazipan
0
510
Memulai karir sebagai web programmer
mazipan
0
750
Membuat laporan kecepatan web untuk blog
mazipan
0
540
Bongkar Dapur Webnya #PHPID-OL
mazipan
0
530
Other Decks in Programming
See All in Programming
レイトレZ世代に捧ぐ、今からレイトレを始めるための小径
ichi_raven
0
470
Querying Design System デザインシステムの意思決定を支える構造検索
ikumatadokoro
1
1.2k
目的で駆動する、AI時代のアーキテクチャ設計 / purpose-driven-architecture
minodriven
11
3.5k
アーキテクチャと考える迷子にならない開発者テスト
irof
9
3.3k
Why Kotlin? 電子カルテを Kotlin で開発する理由 / Why Kotlin? at Henry
agatan
1
110
TypeScript 5.9 で使えるようになった import defer でパフォーマンス最適化を実現する
bicstone
1
500
Building AI with AI
inesmontani
PRO
1
260
Eloquentを使ってどこまでコードの治安を保てるのか?を新人が考察してみた
itokoh0405
0
3.2k
Feature Flags Suck! - KubeCon Atlanta 2025
phodgson
0
170
Level up your Gemini CLI - D&D Style!
palladius
1
120
Rails Girls Sapporo 2ndの裏側―準備の日々から見えた、私が得たもの / SAPPORO ENGINEER BASE #11
lemonade_37
2
190
Developing Specifications - Jakarta EE: a Real World Example
ivargrimstad
0
230
Featured
See All Featured
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
9
980
How To Stay Up To Date on Web Technology
chriscoyier
791
250k
BBQ
matthewcrist
89
9.9k
Code Reviewing Like a Champion
maltzj
527
40k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
48
9.8k
Java REST API Framework Comparison - PWX 2021
mraible
34
9k
The MySQL Ecosystem @ GitHub 2015
samlambert
251
13k
Designing for humans not robots
tammielis
254
26k
Rebuilding a faster, lazier Slack
samanthasiow
84
9.3k
How STYLIGHT went responsive
nonsquared
100
5.9k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
140
34k
ReactJS: Keep Simple. Everything can be a component!
pedronauck
666
130k
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.