Android Start-up Performance

Stages of Start-up

Every Android component (activities, broadcast receivers, etc) can be a start-up entry point for Chrome. The main start-up scenarios we optimize for are:

  • Launching from the home screen
  • Handling a View intent
  • Showing a Chrome Custom Tab

For a home screen launch, we consider start-up to be complete once the Activity is rendered. For the latter two, we care both about:

UMA

Here are some UMA metrics that measure start-up (UMA's UI has descriptions):

  • Startup.Android.Cold.TimeToFirstVisibleContent
  • Startup.Android.Cold.TimeToFirstNavigationCommit.Tabbed
  • Browser.PaintPreview.TabbedPlayer.TimeToFirstBitmap
  • Startup.Android.Cold.TimeToFirstContentfulPaint.Tabbed

This one can be useful for measuring dex optimization changes:

  • Startup.LoadTime.ProcessCreateToApplicationStart

For Googlers, there's more background in this doc.

ChromePerf

Here are some chromeperf metrics that measure start-up in a lab environment:

  • ChromiumPerf/android-pixel4-perf/startup.mobile / messageloop_start_time
  • ChromiumPerf/android-pixel4-perf/startup.mobile / navigation_commit_time
  • ChromiumPerf/android-pixel4-perf/startup.mobile / first_contentful_paint_time

Pinpoint

When using Pinpoint to test start-up changes, make sure to:

  • Use bundles rather than APKs.
    • For 32-bit: --browser=android-trichrome-bundle
    • For 64-bit: --browser=android-trichrome-chrome-google-64-32-bundle
  • Compile DEX: --compile-apk=speed

Some start-up changes can improve start-up for high-end devices but degrade it for low-end ones (or vice versa). It is important to test both.

  • Use android-go-* devices to test low-end.
  • Use android-pixel6-* to test high-end. They set is_high_end_android=true.