Writing performant layouts
summary
Shows how nested layouts cause double measurement (two passes) and jank, and how tools find the culprits: Layout Inspector, Lint, Systrace/Frame Metrics API and Android Profiler (look for red frames >16ms, example 20ms). Replacing nested includes with the merge tag and using ViewStub to delay inflation cuts cost; prefer ConstraintLayout for complex screens (measured ~40% faster vs nested Relative/Linear) and FrameLayout for overlays. Notes tradeoffs: merge breaks data binding and ConstraintLayout can be harder to maintain.
AI-written summary · about
chapters (11)
- 0:00Introduction to layout performance
- 2:25How Android renders frames
- 4:15Diagnosing layout issues with tools
- 6:01Why layouts cause jank
- 8:56Optimizing nested layouts with merge tag
- 10:20Choosing efficient parent layouts
- 11:47ConstraintLayout vs RelativeLayout
- 13:32Delaying view inflation with ViewStub
- 16:05Quick recap of optimizations
- 17:08Drawbacks of optimizations
- 18:37Q&A








