Open Bug 1807319 Opened 2 years ago Updated 2 years ago

Analyze start up duration telemetry (discrepancy in onCreate duration telemetry vs. local Moto G5)

Categories

(Firefox for Android :: Performance, defect)

All
Android
defect

Tracking

()

Performance Impact none

People

(Reporter: cpeterson, Unassigned)

Details

From github: https://github.com/mozilla-mobile/fenix/issues/18426.

The perf_startup_home_activity_on_create probe measures HomeActivity.onCreate and looks like this:

The perf_startup_application_on_create probe measures the duration of Application.onCreate. The results look like this:

To sanity check these values, I measured these values locally on the Moto G5 (a slighly less than low-end device for our users) and compared it with the received telemetry (Beta channel 2021-03-05 build). Activity.onCreate seems to match up: median 191 ms (202ms for first run) on the G5 which puts it comfortably within the 75th percentile (134ms) and the 95th percentile (268ms). However, Application.onCreate does not match up: median is 432.5ms (521ms for first run) which is towards the bottom within the 50th (414ms) and 75th (696ms).

This comes down to the key discrepancy: I'd expect the Moto G5 to be consistent between the probes but it's not. Our intuition for Moto G5 performance seems aligned with Activity.onCreate so this makes Application.onCreate seem suspicious but it's not necessarily the cause.

A second discrepancy is that the distribution of these two probes is different: app.onCreate has a larger gap to the 95th percentile, which has an unexpectedly high duration (1.8s). This also points to app.onCreate as being suspicious.

We should investigate the cause of this discrepancy – for example, perhaps there is a performance issue in app.onCreate.


We already know there are differences between these probes that could be related:

  • App.onCreate and Activity.onCreate aren't called the same number of times and may be called under different conditions (e.g. if the device is low on memory, we're more likely to see App.onCreate called when fenix is opened)
  • FenixApplication may be paired with activities besides HomeActivity, which may affect the conditions under which it's called
  • FenixApplication.onCreate will always lazily initialize the same pieces of code. However, if HomeActivity.onCreate is called when the process is already alive, it may run different code based on what components are already lazily initialized (e.g. if HomeActivity was already created) – it may be faster
  • HomeActivity.onCreate may be able to restore a layout from a bundle, which could speed up performance

Also, I don't know how the data is aggregated (i.e. how does a single user contribute to this visualization?) so that could be another cause of discrepancy.

┆Issue is synchronized with this Jira Task

Change performed by the Move to Bugzilla add-on.

The severity field is not set for this bug.
:cpeterson, could you have a look please?

For more information, please visit auto_nag documentation.

Flags: needinfo?(cpeterson)
Flags: needinfo?(cpeterson)

The Performance Impact Calculator has determined this bug's performance impact to be none. If you'd like to request re-triage, you can reset the Performance Impact flag to "?" or needinfo the triage sheriff.

Platforms: Android
Websites affected: Rare

Performance Impact: --- → none
Severity: -- → S4
You need to log in before you can comment on or make changes to this bug.