Skip to main content

Other performance issues

Besides ANRs and slow screens, slow startups and crashes, Kotzilla detects the issues below. They often cause the main three: a slow component left alone can turn into an ANR or a slow startup.

This page grows as new issue types ship.

IssueThresholdWhat it means
Main thread performance100 msA component takes too long to be created on the main thread.
Background thread performance200 msA component takes too long to be created on a background thread.
Slow transition500 msA screen takes too long to become interactive after navigating to it.

For any of them, the fastest path is to ask your AI agent connected to the Kotzilla MCP Server to fix it, for example Fix the main thread issue on SettingsViewModel and close it once the fix is verified. The agent gets the dependency tree and timings of the issue and the fix patterns for its type, then verifies the fix on a fresh session.

Main thread performance​

Raised as <Component> Resolution is Blocking Main Thread when a component takes more than 100 ms to be created on the main thread, dependencies included.

While the main thread creates the component, the screen cannot draw or respond to input. One 100 ms component is barely visible, but several on the same screen add up to a slow screen, and past 4.5 seconds to an ANR.

To find the cause, open the issue, then an impacted session, and compare the component with its dependencies in the dependency tree:

  • If the component is slow and its dependencies are fast, the time goes into its own constructor or init block. Move the work to viewModelScope or a background dispatcher, and keep construction instant.
  • If one dependency is slow, fix that dependency: cache it, create it lazily, or move its work off the main thread.
  • If many dependencies are each a little slow, the component pulls in too much. Split it, or inject the heavy parts lazily with inject() or lazy.

In the codelab, MainActivityViewModel takes about 5 seconds to be created on the main thread, while its dependencies take a few milliseconds, so the work is in its constructor. See Fix ANRs and slow screens for the fix.

Background thread performance​

Raised as <Component> Resolution is Blocking Background Thread when a component takes more than 200 ms to be created on a background thread, and critical at 400 ms.

Background work does not freeze the screen. It can still delay what the user is waiting for: data that loads late, a sync that holds a lock the main thread needs, or work that competes with the first screen during startup.

To fix it, look at when the component is created. If it is created during startup, take it off the startup path. If its constructor does the work, move the work to a method that runs when needed, for example doWork() in a CoroutineWorker. If another thread waits for it, create it ahead of time or break the dependency.

In the codelab, the sync worker (androidx.work.ListenableWorker) takes about 2 seconds to be created on a background thread. It starts from Application.onCreate, so it runs inside the cold start window. The fix keeps construction instant and does the work in doWork(). See Fix slow app startup.

Slow transitions​

Raised as <Screen> Screen is Slow to Become Interactive when a screen takes more than 500 ms from its creation to being fully resumed, after navigating to it. This time to interactive includes the navigation transition.

The screen may already be drawn while the user still cannot use it. A screen that draws in 10 ms and becomes interactive 700 ms later feels slow, even though nothing blocks the main thread.

In the session timeline, compare the Visible state of the screen (its render time) with its Resumed state (its time to interactive). A long gap with nothing on the main thread in between usually means the transition animation. When several screens show nearly the same number, look for one shared cause.

NavHost defaults to a 700 ms crossfade, and a destination is not interactive until the animation finishes. Shorten the transitions:

NavHost(
navController = navController,
startDestination = ForYouRoute,
enterTransition = { fadeIn(animationSpec = tween(200)) },
exitTransition = { fadeOut(animationSpec = tween(200)) },
) {
// destinations
}

Since the delay comes from the animation itself, choose the duration with your designers.

In the codelab, the Search, Saved and For You screens become interactive in 630 to 680 ms, all close to the default 700 ms crossfade. We did not add this one: it ships in Now in Android today.

Retired issue types​

Since August 2026, three issue types are no longer detected, because they created too much low-signal noise:

  • Dependency Performance: the total resolution time of a component exceeded 5 ms per dependency.
  • Child Dependency Performance: one dependency took more than 5 ms per call.
  • Dependency Complexity: a component had more than 5 dependencies.

A resolution over 100 ms on the main thread is still detected, as a Main thread performance issue, so the cases that affect users still appear. Sessions analyzed before the change still show the retired types, and new sessions do not.