Closed Bug 2043539 Opened 6 months ago Closed 1 month ago

Normandy init seems to take quite a long time on initial startup, potentially impacting new profile success / activation / retention

Categories

(Firefox :: Normandy Client, defect)

Desktop
All
defect

Tracking

()

RESOLVED WONTFIX

People

(Reporter: Gijs, Unassigned)

References

Details

(Whiteboard: [nimbus])

Trigger for digging into this: bug 1951731. That bug is about the impact of figuring out the user's home region (by means of a network request) on nimbus startup, and in turn the impact of that on initial profile startup (on second startup, the value will be cached). There is a bug right now where that request happens quite early on in startup and effectively blocks nimbus startup; in principle we could make it slightly lazier by fixing the issue identified in bug 1951731 comment 7, but it would still effectively block Nimbus startup and be slightly slower. A better fix would likely be finding an initial value that we can use and relying on the region stuff less on initial profile startup. But that can all happen in that bug.

In the context of this work I was asked about the potential impact of Nimbus startup on initial profile startup. This bug attempts to summarize some of my findings. TL;DR there appears to be some significant impact for some subset of users, enough that I think it's worth digging into more. It isn't at all clear yet what a solution looks like here, but I have found enough that I think it's worth digging into this more, and I'm reaching the limits of what I can easily/usefully do (i.e. that other people with dedicated time would not be able to do better or more quickly).

Quoting Beth:

On Windows under first startup, we invoke FirstStartup.sys.mjs and it delays first paint and spins the event loop until either (a) all init tasks [including Nimbus] complete or (b) we timeout, at which point we start painting

(on non-Windows, this case doesn't really happen and we don't block paint on these tasks completing)

There is some telemetry for this.

The graph for that telemetry on release suggests that we have 4-5 million pings each major release, for this "first startup" code running, and that the median (50th percentile) for Normandy init time is around 4.5 seconds. However, the 75th percentile is 7-8 seconds, and the 95th percentile is at or close to 30 seconds. AIUI the 30 seconds is also the cutoff where --first-startup will "give up" or stop waiting.

That's 30 seconds in which there is nothing on the screen for the user to look at (or maybe we're still showing the installer during --first-startup? It's not 100% clear to me - Nick, do you know? (please redirect as appropriate)).

The way I'm thinking about this is... is there any way to make the Nimbus/Normandy init faster (possibly requires more instrumentation so we find out which part of normandy init is slow? It could be the region request but it could also be many other things), and can/should we do something here so we abort earlier or at least stop blocking "first startup" and initial paint on this?

Ni's for comment 0.

Flags: needinfo?(nalexander)
Flags: needinfo?(brennie)
Depends on: 2043752

I've filed a bug to add metrics around Nimbus first startup that I'll try to get to early next week.

Flags: needinfo?(brennie)

We investigated this together:

https://docs.google.com/document/d/1u-bLiEpPjM-HFSlmCns8OrpIjVYQaA1r8-MzpqcnvvM/edit?tab=t.0#heading=h.t9n549tnwy6u (LDAP only)

and concluded the measured effect was not big enough to warrant any major intervention.

We can reopen/refile this later if it comes up again.

Status: NEW → RESOLVED
Closed: 1 month ago
Resolution: --- → WONTFIX

Clearing the needinfo request since this bug has been closed as WONTFIX for 1 month.

For more information, please visit BugBot documentation.

Flags: needinfo?(nalexander)
You need to log in before you can comment on or make changes to this bug.