Jank & Rendering Quiz

PERFORMANCE › Runtime

What is the approximate per-frame time budget to sustain 60fps?

Answer: 16ms

60fps means a new frame every 1000/60 ms, so each frame's work must complete in about 16ms; 8ms corresponds to 120fps and 11ms to 90fps.

Which thread actually executes the GPU draw commands (DrawFrame) for a frame?

Answer: RenderThread

The UI thread records drawing into a display list, but RenderThread performs DrawFrame: syncing, texture upload, and issuing GPU draw calls.

In Android vitals, an app is flagged for slow rendering when roughly what share of its frames take longer than 16ms?

Answer: 25%

The slow-rendering bad-behavior bar is about 25% of frames exceeding 16ms; the separate frozen-frames bar is about 0.1% of frames exceeding 700ms.

What does the Debug GPU Overdraw overlay in Developer Options visualize?

Answer: How many times each pixel was drawn in a single frame

Debug GPU Overdraw color-codes pixels by how many times they were drawn in a frame (true color/blue is 1x, red is 4x+), highlighting wasted fill rate.

Which tool is the best fit for catching frame-timing regressions on real UI interactions in CI?

Answer: Macrobenchmark with FrameTimingMetric on a real device

Macrobenchmark runs scripted interactions on a physical device against a release-like build and reports frame-duration percentiles, making it suited to automated regression tracking.

Scroll jank traces to excessive Compose recomposition. Which is the most effective fix?

Answer: Use stable types and defer state reads via remember/derivedStateOf

Reducing recomposition relies on stability and scoping/deferring state reads; notifyDataSetChanged is a View/RecyclerView API, composition must run on the main thread, and you cannot raise the display's frame budget.

An app's main thread is blocked for about 6 seconds. What does the Android system report?

Answer: An ANR (Application Not Responding) event

Main-thread unresponsiveness of roughly 5s or more triggers an ANR; frozen frames are the 700ms to 5s range, and dropped frames are sub-5s rendering stalls.

Which component schedules UI work to align with the display's VSYNC signal and drives the per-frame callback that runs input, animation, measure, layout, and draw?

Answer: Choreographer

Choreographer receives the VSYNC pulse and posts the frame callback that runs the UI-thread work for each frame; SurfaceFlinger is the system compositor and WindowManager/HandlerThread are unrelated to per-frame scheduling.

You want to attribute real-user jank to specific screens or UI states in production. Which AndroidX library is purpose-built for that?

Answer: JankStats

JankStats is the AndroidX library for field/production jank monitoring, reporting per-frame FrameData with attached UI state; Macrobenchmark and the others are lab/profiling tools, not in-production reporters.

Above what render duration does Android vitals classify a frame as a frozen frame?

Answer: 700ms

Frozen frames are those taking longer than 700ms; 16ms is the slow-frame line and ~5000ms is the ANR territory for a blocked main thread.

Which developer tool helps you automatically catch accidental disk or network reads happening on the main thread during development?

Answer: StrictMode

StrictMode's thread policy detects main-thread disk and network access (and other violations) and can log or crash on them; the others do not flag main-thread I/O.

A composable reads a frequently-changing scroll offset to compute a boolean (e.g., whether to show a 'scroll to top' button), causing recomposition on every scroll pixel. Which API best limits recomposition to only when the boolean actually flips?

Answer: derivedStateOf

derivedStateOf creates a derived state that only triggers downstream recomposition when its computed result changes, not on every read of the rapidly-changing source state.

During fast scrolling an app allocates many short-lived objects each frame and stutters intermittently. What is the most likely mechanism behind the jank?

Answer: Garbage-collection pauses on the main thread eat frame time

Heavy per-frame allocation pressure provokes garbage collection whose pauses can run on or block the main thread, eating into the frame budget; allocations do not directly affect GPU rasterization or SurfaceFlinger.

Why does shipping a Baseline Profile reduce jank, particularly during the first runs after a fresh install or update?

Answer: It AOT-compiles hot startup and scroll paths to skip runtime JIT costs

A Baseline Profile guides AOT compilation of the listed hot methods at install time, so critical paths run as optimized native code instead of being interpreted/JIT-compiled on first use, cutting first-run jank.

Back to Jank & Rendering