Open Bug 1813248 Opened 2 years ago Updated 1 year ago

Glean code adds ~61ms on COLD start up, all types

Categories

(Firefox for Android :: Performance, defect)

All
Android
defect

Tracking

()

Performance Impact low

People

(Reporter: boek, Unassigned)

Details

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

We ran an experiment where we "removed" Glean and measured the COLD start up duration: it improved median start up performance by 61ms on Nightly builds on the Moto G5. A 61ms potential improvement is significant: it's the largest remaining win we've found for all start up types.

To "remove" glean, we:

Note: there's still 13ms of Glean related code in the profile for the experiment https://share.firefox.dev/3kj9PYN so this wasn't a perfect removal and the wins could be greater (or less).

In theory, a performance-first implementation shouldn't have much overhead: for each recorded metric, it could queue the data in memory and, only after we've finished start up, we could do the heavy lifting to initialize Glean and transmit any pings. With this theory in mind, it seems like we can improve on the current implementation. That being said, the product team may prefer to take a performance hit, e.g. to send data earlier so we should discuss what are requirements are and work within them.

Marc mentioned a large part of this overhead may be attributable to the first SharedPrefs read (I think to determine if Glean is enabled or not).

┆Issue is synchronized with this Jira Task

Change performed by the Move to Bugzilla add-on.

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

Platforms: Android
Impact on browser: Causes noticeable startup delay
Websites affected: Rare

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