Closed Bug 1593579 Opened 5 years ago Closed 5 years ago

service worker - slow instantiating or slow pulling cache in GeckoView Android app

Categories

(Core :: DOM: Service Workers, enhancement, P3)

71 Branch
Unspecified
Android
enhancement

Tracking

()

RESOLVED DUPLICATE of bug 1336199
Tracking Status
firefox72 --- affected

People

(Reporter: colormatch, Unassigned)

Details

User Agent: Mozilla/5.0 (Windows NT 6.2; Win64; x64; rv:70.0) Gecko/20100101 Firefox/70.0

Steps to reproduce:

Service workers are not immediately available, or are pulling cached resources slowly, which may result in sluggishly booting apps using GV.

Setup:
A small fast initial html, and larger second resource file.
After first run, the second (resource) file is cached and delivered through a service worker.

Running the app in Chrome-desktop, resource file is loaded immediately.
Running the app in Firefox-desktop, resource file is loaded with small delay (~150ms)
Running the app in WebView-Android Phone, resource file is loaded with small delay (~150ms)
Running the app in GeckoView-Android Phone, resource file is loaded after about ~1,000ms (1 sec)

By the timing alone, it's hard to tell if GV is pulling the resource file from the server or not, as it takes the same time (in my case) for the app to download and load the resource file, as the time to get it from the service worker / cache.

Sending this bug to the Service Worker Bugzilla component.

Running the app in GeckoView-Android Phone, resource file is loaded after about ~1,000ms (1 sec)

Is this slow loading problem reproducible in Firefox Preview (Fenix) or the GeckoViewExample app?

Component: General → DOM: Service Workers
OS: All → Android
Product: GeckoView → Core
Summary: service worker - slow instantiating or slow pulling cache → service worker - slow instantiating or slow pulling cache in GeckoView Android app
Priority: -- → P3

(In reply to Chris Peterson [:cpeterson] from comment #1)
..

Is this slow loading problem reproducible in Firefox Preview (Fenix) or the GeckoViewExample app?

Yes.
(tested Fenix)

Looking a bit more into it, (I'm guessing here) it seems this may be due to caching compiled code in network cache, which gets scrubbed in reloading.

Mapping the source content to the decoded / compiled version of the source (available after page reload), ** for the assets delivered by the service-worker **, should produce an increased performance load for a lot of web-sites too.

i.e. - cache and deliver the compiled bytecode of sw's assets (even after reload).

That's probably bug 1336199 then plus related follow-ups (including some new ones we'll likely file).

(In reply to Andrew Sutherland [:asuth] (he/him) from comment #4)

That's probably bug 1336199 then plus related follow-ups (including some new ones we'll likely file).

sounds like it.

You can see the effect on kinoseed dot com.
After the first page visit, everything is served by the service-worker.
The page initially is loading a light UI (10k), and then an operational resource 200k, which brings up LUT selection when loaded.
Refresh the page and you will see the delay in action.

marking the bug as duplicate of bug 1336199

Status: UNCONFIRMED → RESOLVED
Closed: 5 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.