Fenix pageload progress bar can take multiple times longer to complete than Chrome (e.g. 50 seconds vs 10 seconds)
Categories
(Core :: Performance: General, defect, P1)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox136 | --- | fixed |
People
(Reporter: acreskey, Assigned: kaya)
References
(Blocks 4 open bugs)
Details
(Whiteboard: [avocado sprint])
User Story
Added to high friction list because this appears to a cause of a recurring theme from from Google Play Store reviews: slow page loading, pages not loading
e.g.
```
Felt Slowness
Description: Users are reporting slow page loading, pages not loading, slow browsing speed, slow app responsiveness, and slow media.
```
Attachments
(10 files)
|
8.43 MB,
video/quicktime
|
Details | |
|
8.34 MB,
video/quicktime
|
Details | |
|
7.27 MB,
video/quicktime
|
Details | |
|
2.70 MB,
video/mp4
|
Details | |
|
8.08 MB,
video/quicktime
|
Details | |
|
1.94 MB,
video/mp4
|
Details | |
|
1.58 MB,
video/mp4
|
Details | |
|
582.22 KB,
video/mp4
|
Details | |
|
626.47 KB,
video/mp4
|
Details | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review |
The pageload progress indicator in Fenix can drag on well beyond the point at which the content is loaded and rendered.
Compared to Chrome this can lead to a lower quality user experience as it appears that the page is still loading.
Steps to Reproduce:
To emphasize the impact, ensure you are on a slower network.
For example, the videos attached were made on a network with 3mbps throughput and ~300ms rtt latency.
Load a large top site (e.g. nytimes.com wsj.com etc)
Observe how long it takes for the page load progress bar to complete
Expected Results:
Pageload progress bar completes roughly when page is loaded
Actual Results:
In Fenix the indicator can stall and take up to 50seconds (as in the video)
In Chrome, same network, same site, I am seeing the progress bar complete in about 10 seconds.
System configuration:
Samsung A54
| Reporter | ||
Comment 1•1 year ago
|
||
Fenix loading nytimes on slower network, part 1 of 2 due to file size restrictions.
| Reporter | ||
Comment 2•1 year ago
|
||
Fenix loading nytimes on slower network, part 2 of 2 due to file size restrictions.
| Reporter | ||
Comment 3•1 year ago
|
||
| Reporter | ||
Updated•1 year ago
|
| Reporter | ||
Comment 4•1 year ago
|
||
The pageload progress bar was a bit faster in this profile, but still about 27 seconds long
| Reporter | ||
Comment 5•1 year ago
|
||
And a 36 second document load with nsHttp logs as markers
https://share.firefox.dev/4cRmNqK
| Reporter | ||
Comment 6•1 year ago
|
||
| Reporter | ||
Comment 7•1 year ago
|
||
Not clear yet, but perhaps Chrome is completing the progress bar on DomContentLoaded?
| Reporter | ||
Comment 8•1 year ago
|
||
As Markus pointed out, while the progress bar completed in the Chrome load (comment 6), but the load event had not yet fired.
In this Chrome trace we can see DCL firing just before 12 seconds but the load event not until much later, about 23 seconds.
The progress bar completes much closer to DCL, roughly at around 10-12 seconds.
| Reporter | ||
Comment 9•1 year ago
|
||
In bug 1889771 we just increased the maximum parallel http connections on Android from 40 to 128.
We have data from CI and local tests that show (as expected) that one impact of the change is load time being decreased, sometimes by up to 40%.
We should re-test this with the 128 socket change landed.
| Reporter | ||
Comment 10•1 year ago
|
||
(In reply to Andrew Creskey [:acreskey] from comment #9)
In bug 1889771 we just increased the maximum parallel http connections on Android from 40 to 128.
We have data from CI and local tests that show (as expected) that one impact of the change is load time being decreased, sometimes by up to 40%.We should re-test this with the 128 socket change landed.
From local tests on nytimes.com, cnn.com, the slow progress bar is not improved with bug 1889771.
| Reporter | ||
Comment 11•1 year ago
|
||
https://cnn.com in particular makes a very good test case.
On the same network, 3mbps throughput and ~300ms rtt latency:
Chrome has the loading progress bar complete in under 10 seconds.
In Fenix, it's about 1 minute or longer.
In this profile, resources continue to trickle in for about 90 seconds, at which point the loading indicator finally completes:
https://share.firefox.dev/3Lv96C0
Updated•1 year ago
|
Updated•1 year ago
|
| Reporter | ||
Comment 12•1 year ago
•
|
||
In bug 1915490 and bug 1915186 we've standardized how we categorize and prioritize trackers between nightly/beta/release.
So retesting this one, but still seeing Chrome complete the progress bar within 10-20 seconds while in Fenix it drags on, sometimes indefinitely.
See video attachments.
| Reporter | ||
Comment 13•1 year ago
|
||
Chrome loading https://www.cnn.com on a RogersInAbox "3g slow" throttled network.
The progress bar completes in about 18 seconds. (Note that the primary image does not even load).
| Reporter | ||
Comment 14•1 year ago
|
||
Fenix nightly, 09/11/2024, loading https://www.cnn.com on the same RogersInAbox "3g-slow" configuration.
I had to trim the video to fit within Bugzilla file limits, but the progress doesn't actually complete even though all the visual content has has been loaded and displayed for quite some time.
| Reporter | ||
Comment 15•1 year ago
|
||
I tried capturing profiles of the near-infinite progress bar, but when profiling so far I'm seeing it complete at about 34seconds, while the images are loaded at about 19 seconds. Not great, but this isn't the problematic scenario that I see in general, and in the videos.
| Reporter | ||
Comment 16•1 year ago
|
||
I think good next steps on this one could be to find a scenario where multiple people can reproduce a large difference in progress bar times, Fenix to Chrome.
Perhaps https://www.cnn.com, current Fenix Nightly, with 3g-slow or 3g-fast is that scenario, but it's not clear.
With that determined, we can capture nsHttp:5 and related logs, as well as performance profiles, to understand what's happening.
| Reporter | ||
Comment 17•1 year ago
|
||
I'm going to see if this is related to the class-of-service tailing that defers tracking requests.
| Reporter | ||
Comment 18•1 year ago
|
||
Disabling tailing doesn't seem to resolve the endless progress bar that I'm seeing.
It does seem to affect android pageload tests in CI though, which I'll summarize in bug 1915866
| Reporter | ||
Comment 19•1 year ago
|
||
Collecting some findings and patches of Kaya's
Browser Page Load Progress Bar Completion Comparison
https://docs.google.com/presentation/d/1dZldCss2hDTQO4S8MPgk801GFVnMIVGyDTIL2PgPlT4/edit#sl
And patches that adjust when the geckoview progress bar is completed: at MozAfterPaint and at DomContentLoaded.
| Reporter | ||
Comment 20•1 year ago
|
||
I'm going to investigate what's in the document loadgroup and why those resources take 50+ seconds to load.
| Reporter | ||
Comment 21•1 year ago
|
||
I've built a test page that highlights the different progress bar behaviours between Chrome Mobile and Fenix:
https://acreskeymoz.github.io/slow/slow_images.html
• There is a long running script that blocks DomContentLoaded (both browsers display the progress bar at about 25%)
• The page contains a medium size image and some larger ones which take multiple seconds to load (two below the fold)
• On DomContentLoaded and the first paint, Chrome completes the progress bar. Images are still loading. This is about 13 seconds before the onload event.
• Fenix waits until the onload event to complete the progress bar.
See attached videos. No network throttling required to reproduce.
| Reporter | ||
Comment 22•1 year ago
|
||
Fenix loading the test page.
| Reporter | ||
Comment 23•1 year ago
•
|
||
Chrome loading the test page.
| Reporter | ||
Comment 24•1 year ago
|
||
On desktop, as far as I can tell, both Chrome and Firefox run the throbber until the onload event is fired.
On mobile, I find Chrome's behaviour to give a much better user experience, especially on content-heavy sites on slower networks where the Fenix progress bar can run for over a minute, eg, cnn.
I propose that we try out completing the progress bar after the first MozAfterPaint following DOMContentLoaded (maybe nightly only).
| Reporter | ||
Comment 25•1 year ago
|
||
If you're curious as to why Fenix displays the content much sooner on this site, it's because gecko crunches through the long running script, below, about 3x faster than Chrome.
let n = 1000000000;
let result = 0;
for (let i = 0; i < n; i++) {
result += Math.sqrt(i);
}
I've updated the test site to output the duration of the script: https://acreskeymoz.github.io/slow/slow_images.html
| Reporter | ||
Comment 26•1 year ago
|
||
Let's try a perfetto trace to verify the Chrome behaviour on the test page.
| Reporter | ||
Comment 27•1 year ago
•
|
||
I haven't been able to figure out what Chrome is doing with respect to the Android progress bar from the perfetto trace
(One is here if anyone is interested).
But I've constructed a simpler site that demonstrates the behaviour of both browsers:
https://acreskeymoz.github.io/slow/slow_requests.html
Here’s the observed behavior:
- DOMContentLoaded takes a bit over 5 seconds (due to a script loaded via slowfil.es).
- At DOMContentLoaded/ document interactive, Chrome immediately completes the progress bar.
- A new, slow-loading script (8 seconds) is dynamically added to the document.
- Both browsers reach onload at ~16 seconds.
- In Fenix, the progress bar completes only after onload.
This highlights a discrepancy in progress bar handling between Chrome and Fenix.
I think that for the mobile experience, completing the progress bar on the first paint after DomContentLoaded provides a better experience.
| Reporter | ||
Comment 28•1 year ago
|
||
We can compare the behaviour of Fenix (left) to Chrome (right) on the slow request test site.
| Reporter | ||
Comment 29•1 year ago
|
||
Kaya, unless there are objections can you make a variation of your earlier patches in which we complete the progress bar on the first paint after dom content loaded?
We can land this as nightly-only to give folks more of a chance to try it out.
| Assignee | ||
Updated•1 year ago
|
| Reporter | ||
Comment 30•1 year ago
|
||
https://acreskeymoz.github.io/slow/slow_requests_async.html
Added a test in which the slow loading script after DCL is an async script.
We see the same behaviour -- Fenix waits for onLoad event to complete the progress bar while Chrome completes it on DCL / interactive.
| Assignee | ||
Comment 31•1 year ago
|
||
The default value for Nightly is set to 2, which completes the page load progress bar at the first MozAfterPaint callback after DOMContentLoaded. The completion on the other channels are kept as it is.
| Reporter | ||
Comment 32•1 year ago
|
||
We have a probe that records geckoview page load progress time, but it's not clear to me that values are recorded:
https://dictionary.telemetry.mozilla.org/apps/fenix/metrics/geckoview_page_load_progress_time
| Assignee | ||
Comment 33•1 year ago
|
||
:acreskey, we have a stopwatch that's attached to this metric, that we start and stop according to the page load, here: https://searchfox.org/mozilla-central/rev/d1e731d931b7b46237175de1701849a7cf5c8579/mobile/shared/modules/geckoview/GeckoViewProgress.sys.mjs#190-192
We start if off when the page load starts, here: https://searchfox.org/mozilla-central/rev/d1e731d931b7b46237175de1701849a7cf5c8579/mobile/shared/modules/geckoview/GeckoViewProgress.sys.mjs#215
Then, we stop it at several places in GeckoViewProgress (page load finish, error case etc.), here's where a successfull pageStop might have happened that we stop the stopwatch with a successful page load state: https://searchfox.org/mozilla-central/rev/d1e731d931b7b46237175de1701849a7cf5c8579/mobile/shared/modules/geckoview/GeckoViewProgress.sys.mjs#473
Updated•1 year ago
|
| Reporter | ||
Comment 34•1 year ago
|
||
(In reply to Kayacan Kaya [:kaya] from comment #33)
:acreskey, we have a stopwatch that's attached to this metric, that we start and stop according to the page load, here: https://searchfox.org/mozilla-central/rev/d1e731d931b7b46237175de1701849a7cf5c8579/mobile/shared/modules/geckoview/GeckoViewProgress.sys.mjs#190-192
We start if off when the page load starts, here: https://searchfox.org/mozilla-central/rev/d1e731d931b7b46237175de1701849a7cf5c8579/mobile/shared/modules/geckoview/GeckoViewProgress.sys.mjs#215
Then, we stop it at several places in GeckoViewProgress (page load finish, error case etc.), here's where a successfull pageStop might have happened that we stop the stopwatch with a successful page load state: https://searchfox.org/mozilla-central/rev/d1e731d931b7b46237175de1701849a7cf5c8579/mobile/shared/modules/geckoview/GeckoViewProgress.sys.mjs#473
I don't think it's necessary to change the glean stopwatch, since, from what I can tell, it's tracking the document pageload (i.e. leading to onload event).
Comment 35•1 year ago
|
||
Comment 36•1 year ago
|
||
| bugherder | ||
Description
•