Open Bug 1820191 Opened 2 years ago Updated 2 years ago

Investigate preloading various data sources to prepopulate the AppStore

Categories

(Fenix :: Homepage, task, P3)

All
Android
task

Tracking

(Not tracked)

ASSIGNED

People

(Reporter: gl, Assigned: gl)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

This investigation is an effort to find a solution that will help reduce the homepage jank on cold start. This is when you navigate to the homepage and see that the homepage is slipping behind your fingers on load because the various components (eg, top sites, jump back in, recent bookmarks, etc) are all being fetched and loaded asynchronously.

We want to examine preloading a handful of data sources (eg top sites, jump back in, etc) that are above the fold (the immediate visible area when hitting the homepage) when you navigate to the homepage when the application is started and populating the AppStore with the data as soon as possible. Currently, we only start fetching these data sources when the HomeFragment is created, which is probably too late and could be done sooner. We already have a concept of warming up our storages and prefetching top sites in https://searchfox.org/mozilla-mobile/source/firefox-android/fenix/app/src/main/java/org/mozilla/fenix/FenixApplication.kt#309. We want to go one step further by dispatching and updating the AppStore.

This will not resolve the jank when cold starting immediately into the homepage, but if we start preloading the sources when cold start navigates to the browser before the homepage, then we should already have the immediate data ready for the homepage in the AppStore.

(In reply to Gabriel [:gl] (ΦωΦ) from comment #0)

We already have a concept of warming up our storages and prefetching top sites in https://searchfox.org/mozilla-mobile/source/firefox-android/fenix/app/src/main/java/org/mozilla/fenix/FenixApplication.kt#309. We want to go one step further by dispatching and updating the AppStore.

This will not resolve the jank when cold starting immediately into the homepage, but if we start preloading the sources when cold start navigates to the browser before the homepage, then we should already have the immediate data ready for the homepage in the AppStore.

It would be best to profile and see what are the real slow parts in data retrieval before we try to optimize with pre-fetching.

Even with pre-fetching, a cold start of top sites is still quite slow (as seen in the attached video where it is the last resource to pop on the screen).

Adding more pre-fetching to the Application class may cause perf losses for cold start to browser open.

The work to pre-fetching at the application start would only give us marginal gains and therefore might not be fruitful.

I would suggest we take measurements first to see what the gains have been for top sites, and what could they be for our other data sources for the homescreen. We can then consider if we should commit towards this direction.


Consider another UX direction where, assuming we have no more large technical perf wins to make, we could use placeholders positions where we draw out the initial home screen scaffolding, and populate it when it's complete (with a short fade in animation).

You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: