Open Bug 1833341 Opened 2 years ago Updated 2 years ago

We read distribution.ini from the main thread on MSIX Firefoxen

Categories

(Firefox :: Installer, defect)

defect

Tracking

()

Performance Impact medium

People

(Reporter: Gijs, Unassigned)

References

Details

(Keywords: main-thread-io, perf, perf:startup)

Found in bug 1831406 trying to get the test re-enabled that prevents new instances of mainthreadio.

If that test hadn't been accidentally disabled, this would otherwise have turned up when we started running these builds on infra.

I don't know if reading this file can be avoided, and/or if it could be sped up in some way, and/or if this only happens on first profile startup (which is what the pre-existing comment for non-msix suggests is the case for the stat call).

Unfortunately, unlike for other test runs, for these failures on msix builds it appears we do not get profiler information so there's no stack trace for the read, and I don't know how to run the test locally against an msix build, so I'm not sure how to get further information.

Performance Impact: --- → ?
Keywords: main-thread-io, perf

I got a profile off try, with this stack:

(root) []
XREMain::XRE_main []
nsObserverService::NotifyObservers final-ui-startup []
XPCWrappedJS method call []
js::RunScript []
BG_observe [resource:///modules/BrowserGlue.sys.mjs:961:36]
BG__beforeUIStartup [resource:///modules/BrowserGlue.sys.mjs:1274:48]
DIST_applyCustomizations [resource:///modules/distribution.js:278:56]
js::RunScript []
get _ini [resource:///modules/distribution.js:79:10]
nsIINIParserFactory.createINIParser []
0x7ff8439a9f42 [xul.dll]

So we only hit it once for new profiles if it doesn't exist (we track that it wasn't there), but if it does exist, we read it at every startup because we need the values in it as part of startup, particularly telemetry (distribution.ini).

It also can contain the homepage.

I wonder if we could either read this async and off the main thread directly, or use Cu.readUTF8File and friends to put it in the off-mainthread preload sequence after the first startup.

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

Platforms: [x] Windows [x] macOS [x] Linux
Impact on browser: Causes noticeable startup delay

Performance Impact: ? → medium
Keywords: perf:startup

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

For more information, please visit BugBot documentation.

Flags: needinfo?(sshatrughan)
Severity: -- → S3
Flags: needinfo?(sshatrughan)
You need to log in before you can comment on or make changes to this bug.