focus-android icon indicating copy to clipboard operation
focus-android copied to clipboard

28ms regression to cold main first frame start up (glean metric native library load?)

Open mcomella opened this issue 3 years ago • 2 comments

We go from 677ms (6/16 Nightly) to 705ms (6/17 Nightly):

image

There may be an additional regression into 6/18 or 6/19 (since it's higher than 6/17) but it is hard for me to determine that through the data so I only filed this bug.

edit: the day after, 6/18, regresses another 34ms (before stabilizing at a slightly lower value for a few days: image

We should consider investigating these together. I filed https://github.com/mozilla-mobile/focus-android/issues/7336 so we don't forget to look into it.

mcomella avatar Jun 21 '22 21:06 mcomella

@mcomella could this be the cause: https://github.com/mozilla-mobile/focus-android/pull/7186 Did a similar regression register when implementing that telemetry in Fenix?

mcarare avatar Jun 22 '22 12:06 mcarare

Actually, it could be – the first use of Glean will load the native library. If that use is on the main thread, it'll delay start up. A different probe causes this in fenix – we filed https://github.com/mozilla-mobile/fenix/issues/23559 for it.

In my opinion, the "correct" solution is for the Glean SDK to load the shared library off of the critical path (e.g. on a background thread or after start up). If the glean team is unable to implement this now (to be explicit, you should ask them if they can!), some options to address this in fenix are 1) force load the Glean native library on a background thread or 2) for each probe, submit the telemetry off the main thread or submit it after start up. Option 2 is unsustainble and error-prone though so I'm hesitant.

mcomella avatar Jun 22 '22 17:06 mcomella

Moved to bugzilla: https://bugzilla.mozilla.org/show_bug.cgi?id=1802636

Change performed by the Move to Bugzilla add-on.

cpeterso avatar Nov 26 '22 05:11 cpeterso