Jank & Rendering
PERFORMANCE › Runtime
How to keep frames under budget and diagnose dropped-frame jank on Android.
Rendering performance is a favorite system-design and debugging interview area because it ties UI code directly to user-perceived smoothness and Play Store standing. Interviewers test whether you understand the per-frame budget, where the render pipeline can stall, and how to measure jank objectively rather than by feel. Expect questions on the main-thread/RenderThread split, overdraw, moving work off the UI thread, Compose recomposition, and Android vitals thresholds.
What this covers
- The frame-budget math: ~16ms at 60fps, ~11ms at 90fps, ~8ms at 120fps, and how missing it makes Choreographer drop the whole frame
- Top jank causes: main-thread work (I/O, synchronous Binder IPC, allocations/GC), heavy/nested layouts, overdraw, and unbounded RecyclerView or Compose work
- The two-stage render pipeline: the UI thread records the display list (measure/layout/draw) and RenderThread executes draw commands on the GPU
- Measuring jank: Macrobenchmark FrameTimingMetric for lab/CI, JankStats for the field, Perfetto/FrameTimeline traces, and Profile GPU Rendering
- Android vitals thresholds: slow frames >16ms, frozen frames >700ms, with bad-behavior bars of ~25% slow and ~0.1% frozen; ANR (~5s) is the related core vital
- Compose-specific jank from excessive recomposition (unstable params, high state reads), fixed with stable types, remember/derivedStateOf, list keys, and baseline profiles
Study this topic
- Jank & Rendering explained: the guided lesson
- 14 practice quiz questions
- 9 revision flashcards
- Jank & Rendering interview questions and answers