Fenix applink load may wait on Network Connectivity Service's initial checks, introducing additional latency on slower networks
Categories
(Core :: Networking, task, P2)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox140 | --- | fixed |
People
(Reporter: acreskey, Assigned: valentin)
References
(Blocks 4 open bugs)
Details
(Whiteboard: [necko-triaged])
Attachments
(3 files)
The exact mechanism isn't clear to me yet, but from a series of Fenix Applink Startup profiles, the network connectivity service's initial checks look to be blocking the document load.
https://share.firefox.dev/41RhIe4
https://share.firefox.dev/422Duf1
https://share.firefox.dev/4l0HhlK
In all of these cases we see the target url, https://theme-crave-demo.myshopify.com/, start to load immediately after the connectivity service's request of http://detectportal.firefox.com/success.txt?ipv6 completes (possibly DNS check).
(I believe these requests are coming from the connectivity service, network.connectivity-service.enabled because the captive portal service appears to be disabled, i.e. network.captive-portal-service.enabled:false)
| Reporter | ||
Comment 1•1 year ago
|
||
Perhaps somewhere up the stack we are blocking on the connectivity service completing initial tests?
I've disabled the connectivity services in this PerfCompare, currently showing a 10% improvement but the test may be noisy so taking with a grain of salt
https://perf.compare/compare-results?baseRev=f6fa6f1d572aed73aaddd82dfda787331616bea5&newRev=c0d19018e3413053fe5a13f18d2e032f8725c671&baseRepo=try&newRepo=try&framework=15
In this profile I've disabled the connectivity service. Still a large delay from the first network requests (location services, wallpers) to the applink target, but that is likely separate issue.
https://share.firefox.dev/4j5pckJ
| Reporter | ||
Updated•1 year ago
|
Comment 2•1 year ago
|
||
This may be on purpose, since a pageload if we're in a captive portal situation will get hijacked.
If it isn't, this could be a win
| Reporter | ||
Comment 3•1 year ago
|
||
The CI runs on the shopify test did not pickup any improvements and I've also since learned that those tests are not stable enough to draw conclusions from.
From a local test, disabling network.connectivity-service.enabled did not yield any improvements.
It looks like load is waiting for the browser to be created, mozilla::dom::ContentParent::CreateBrowser.
See also, bug to create applink host speculative connection, bug 1956356.
| Reporter | ||
Updated•1 year ago
|
| Assignee | ||
Comment 4•1 year ago
|
||
Looking at the profile from comment 1 I did notice that we do two connectivity checks, one in response to the a connectivity change, then one in response to the idle-startup-finished link
I think the good fix here would be to just avoid doing any checks before idle-startup-finished.
| Assignee | ||
Comment 5•1 year ago
|
||
| Assignee | ||
Comment 6•1 year ago
|
||
!!!NOTE!!!
You'll be able to find a performance comparison here once the tests are complete (ensure you select the right framework):
https://perf.compare/compare-results?baseRev=40b49e9bb1737d03e791e4b6517a9a500f265abd&newRev=bb99068e0bc7149592465d2630628365b85d1566&baseRepo=try&newRepo=try&framework=15
The old comparison tool is still available at this URL:
https://treeherder.mozilla.org/perfherder/compare?originalProject=try&originalRevision=40b49e9bb1737d03e791e4b6517a9a500f265abd&newProject=try&newRevision=bb99068e0bc7149592465d2630628365b85d1566&framework=15
-
2 commits/try-runs are created... *
Base revision's try run: https://treeherder.mozilla.org/jobs?repo=try&revision=40b49e9bb1737d03e791e4b6517a9a500f265abd
Local revision's try run: https://treeherder.mozilla.org/jobs?repo=try&revision=bb99068e0bc7149592465d2630628365b85d1566
Comment 9•1 year ago
|
||
Backed out for causing failures at test_network_connectivity_service.js.
Backout link: https://hg-edge.mozilla.org/integration/autoland/rev/02695117ae0e5c4b7ac21e07eb9575051303e494
Failure log: https://treeherder.mozilla.org/logviewer?job_id=507026979&repo=autoland&lineNumber=3743
| Assignee | ||
Updated•1 year ago
|
Comment 10•1 year ago
|
||
Comment 11•1 year ago
|
||
| bugherder | ||
| Reporter | ||
Comment 12•11 months ago
|
||
Even though it has already landed, I compared this patch on the newssite-applink-startup applink_startup (without profiling runs) by disabling the option.
Possibly it's leading to improvements of up to ~2.6% on the test. But I'm adding more retriggers to gain confidence.
I'll try to run it live in a large batch.
If we have evidence that removing the additional requests is measurably beneficial, that could help in deferring all of the other launch request loads.
| Reporter | ||
Comment 13•11 months ago
|
||
Dataset with applink_startup results from Valentin's fix.
| Reporter | ||
Comment 14•11 months ago
|
||
Dataset with applink_startup results where Valentin's fix was reverted via pref
| Reporter | ||
Comment 15•11 months ago
|
||
I compared this fix on a long run of the shopify applink test (250 iterations instead of 5).
It didn't pickup any measurable improvements, but this test is relatively noisy, even locally, standard deviation of 140ms.
We may need to disable all of the requests that preceed the applink URL to measure the impact in a local test.
Description
•