Cold start time

Performance Mid-level Kotlin 2.0+ API 24+ Reviewed By Best Latest Apps

Pick the fix

Startup improved 30% on a debug build but users see no change. What went wrong?

Options
Hint 1 of 1

Which build did they measure?

Choose an answer, then open Show answer below to check it.

Show answer

Answer: A Debug builds aren't representative; measure release builds with Macrobenchmark and a Baseline Profile

Correct. Debug builds have no R8 and no profiles, so results don't transfer.

Why not the others?
  • B Users have slow phones. That's why you measure on mid-range devices, but the build type is the issue here.
  • C Play caches the old APK. Not how updates work.
  • D The emulator is faster. Still not a representative build.

30-second answer

Measure time to initial display (TTID) and time to full display (TTFD, reported with reportFullyDrawn()) with Macrobenchmark's StartupTimingMetric on a release build. Then cut work on the critical path: lazy-initialise SDKs, avoid disk and network before the first frame, simplify the first screen, and ship a Baseline Profile so ART precompiles startup code.

Practise saying it · 35 s. No recording, just a timer

Explain how to improve cold start.

Say your answer out loud, then check which of these points you covered:

  • Measure TTID/TTFD with Macrobenchmark
  • Release builds
  • Lazy init, no I/O before first frame
  • Baseline Profiles
  • SplashScreen API

Deep dive

Cold start: process created; warm: process exists; hot: Activity in memory.

Android vitals flags cold starts of 5 s or more as excessive.

The SplashScreen API keeps the splash until your condition is ready; don't add a separate splash Activity.

Startup Profiles also optimise DEX layout for faster loading.

Common mistakes

  • Measuring debug builds.
  • Adding a splash Activity that delays the real one.
  • Initialising every SDK in Application.onCreate.

Senior take & follow-ups

Give the metrics (TTID/TTFD), the tool and the top three fixes.

Follow-up questions

Think of your answer first, then open the hint.

  1. What's TTFD?

    Show hint

    Time until the app calls reportFullyDrawn, meaning content is ready.

  2. Why use the SplashScreen API?

    Show hint

    It's the system splash on Android 12+ and avoids an extra Activity.

Compare on iOS: Fixing a launch time regression Same metrics problem; iOS measures launch with Instruments and XCTest metrics.

Suggest a fix if something here is wrong or out of date.