Closed Bug 1485092 Opened 7 years ago Closed 7 years ago

uniqlo.com page load is 2x slower in GeckoView than WebView

Categories

(Core :: Layout, defect, P1)

Unspecified
Android
defect

Tracking

()

RESOLVED WORKSFORME
Performance Impact high
Tracking Status
firefox-esr52 --- wontfix
firefox-esr60 --- wontfix
firefox61 --- wontfix
firefox62 --- wontfix
firefox63 --- wontfix
firefox64 --- wontfix

People

(Reporter: cpeterson, Unassigned)

References

(Depends on 1 open bug)

Details

(Keywords: perf:pageload)

A Focus+GV user reports that uniqlo.com takes 17 seconds to load in Focus+GV but only 8 seconds in Firefox Rocket (using WebView). https://github.com/mozilla-mobile/focus-android/issues/3157
Thanks :cpeterson. Feel free to reach out to me for any information!
:ashish can you install Klar 6.1 (which uses WebView) from F-Droid and see how it compares with Focus+GV? https://f-droid.org/en/packages/org.mozilla.klar/
Flags: needinfo?(ashish)
Here is a screencast between Klar 6.1.1 and Focus+GV - https://photos.app.goo.gl/Jk7ZF3xxgS9vfGd17
Flags: needinfo?(ashish)
Whiteboard: [qf] → [qf:p1:f67]
I'm seeing it take 8 seconds in the first part of the screencast (0:04 to 0:12) and 7 seconds in 0:20 to 0:27. So it looks like Focus+GV is actually 1 second faster, not 2x slower... Am I missing something?
(In reply to Daniel Holbert [:dholbert] from comment #4) > I'm seeing it take 8 seconds in the first part of the screencast (0:04 to 0:12) > and 7 seconds in 0:20 to 0:27. er, I left out a few words -- meant to say "and 7 seconds in Focus+GV (0:20 to 0:27)"
Counting to when the main image loads: Klar(8s) - 0:04 to 0:12 Focus(12s) - 0:20(.5) to 0:32(.5) Focus takes at least 6s to even show anything but the white page. When I filed the initial report, I remember counting 8-9s with the loading bar stuck at the 1/4th position and a white screen. Compare that with Klar, which instantaneously (+1s) shows the three dot loading indicator. If there is a way I can get any of the Web Development inspectors, that'd be great. I suspected the initial delay was probably DNS, but I repeated loading the page multiple times, closing Focus often. I picked Rocket only because I wanted to try it out and it had Webview.
(Gotcha - I was waiting for the load bar to finish to determine my "load-complete" -- but yeah, if we wait for the image to load, then it does look like GV takes a bit longer.)
I would also note that klar shows 22 trackers blocked - and focus shows (for me) 0 trackers blocked. That alone could be a huge part of it... is tracker blocking broken?
Kevin said he would retest this bug to make sure: 1. uniqlo.com is serving the same content to WebView and GV. 2. Focus+GV is blocking the same number of trackers as Focus+WebView.
Flags: needinfo?(kbrosnan)
Looking at this from the Firefox/Chrome devtools network inspector using mobile viewports, user agents and no caching the number of load requests varied from 107 to 125. The number of requests was not stable between loads even with the same user agent. Next step may be to capture the requests using a proxy and replay them for better reproducibility. Using the 7.0.12 build of Focus I saw 25 trackers blocked in GeckoView and WebView on a Moto G5 and Galaxy S8. I did see some times after switching from WebView to GeckoView that there were 0 blockers (comment 2). I recall that means we have yet to be able to download the blocklist. Toggling the tracking protection button seems to force a request of the blocklist. That seems like a separate bug for Focus.
Flags: needinfo?(kbrosnan)
64=wontfix because this issue doesn't block Focus 8.0 from using GV 64.
Product: Firefox for Android → GeckoView

I collected two profiles on my Sony Xperia Z3C.
Tracking protection off: https://perfht.ml/2Ubstn6
Tracking protection on: https://perfht.ml/2U3y6Ua

I don't fully understand comment 10 -- do we know for sure if our earlier testing had consistent tracking-protection behavior, when comparing WebView vs. GeckoView settings here?

(Separate data point: Andrew Creskey tested this bug with Focus+GeckoView vs. Chrome today, and says Chrome loads the page noticeably faster.)

Flags: needinfo?(kbrosnan)
Whiteboard: [qf:p1:f67] → [qf:p1:pageload]

Moving to Core::Layout for now, since a decent chunk of the time in comment 12's profiles seems to be in layout & style flushes.

Component: General → Layout
Product: GeckoView → Core

The bigger issue to me is that the total number of resources accessed when visiting the website varied. I would expect that such a variance would result in a different number of items blocked. This seems like something that would benefit from capturing one load and replaying. That would give us a consistent baseline to measure.

Flags: needinfo?(kbrosnan)

Markus, was that an --enable-release build? (That is, was Rust compiled with -C opt-level=1 (opt), or -C opt-level=2 (release)).

I see a few symbols in that profile that I would expect rustc to inline.

(For the comment above)

Flags: needinfo?(mstange)

Oops! I don't think it was. Thanks for catching that!

Flags: needinfo?(mstange)

Profiles with an --enable-release build:
Tracking protection off: http://bit.ly/2R9LMLw
Tracking protection on: http://bit.ly/2R9LPXI

Depends on: 1522196

In Markus's "Tracking protection on" profile in comment 19, it looks like pageload takes ~8 seconds, which was the "target" ("reference measurement") in comment 0.

(RE "pageload", I'm just going off of the screenshots track - the page looks visually complete at the 8 second mark).

So, I wonder if there's anything left to do here? (We've got a helper bug 1522196 that may get us ~100-200ms but that's only a small chunk of the overall load time -- but maybe we're already as fast as anybody in a similar tracking-protection-enabled scenario?)

Flags: needinfo?(cpeterson)

In other words, perhaps this is WORKSFORME, unless/until we get some more actionable measurements demonstrating that GeckoView is slower than WebView (with tracking protection blocking the same rough resources)?

Right now this doesn't feel actionable & it's not clear there's much to be done here.

Let's close this bug as WORKSFORME. On my Moto G5, Chrome and Focus+WebView load uniqlo.com in about 2 seconds. Fennec, Focus+GeckoView, and the Reference Browser load uniqlo.com in about 3 seconds. While technically 50% slower, not a big difference.

Status: NEW → RESOLVED
Closed: 7 years ago
Flags: needinfo?(cpeterson)
Resolution: --- → WORKSFORME
Performance Impact: --- → P1
Keywords: perf:pageload
Whiteboard: [qf:p1:pageload]
You need to log in before you can comment on or make changes to this bug.