This repository has been archived by the owner on Feb 20, 2023. It is now read-only.
Allow prefetching of topsite with observeForever and allow to update homefragment in onCreateView #11660
Labels
Projects
Comments
MarcLeclair
created this issue from a note
in Performance, front-end roadmap
(In progress)
Jun 16, 2020
MarcLeclair
added
performance
Possible performance wins
and removed
needs:triage
Issue needs triage
labels
Jun 17, 2020
MarcLeclair
changed the title
Allow prefetching of topsite with observeForever.
Allow prefetching of topsite with observeForever and allow to update homefragment in onCreateView
Jun 17, 2020
MarcLeclair
added a commit
to MarcLeclair/fenix
that referenced
this issue
Jun 17, 2020
…nCreateView() fixing lint more linting more linting more linting fix
MarcLeclair
added a commit
to MarcLeclair/fenix
that referenced
this issue
Jun 17, 2020
TopSites will be prefetched with observerOnce (wrapper around observerForever). Also, the SessionControlView.update() is called right away instead of waiting from consumeFrom in the HomeFragment.onCreateView() which will allow the UI to render all at once on its first perform traversal
MarcLeclair
added a commit
to MarcLeclair/fenix
that referenced
this issue
Jun 17, 2020
TopSites will be prefetched with observerOnce (wrapper around observerForever). Also, the SessionControlView.update() is called right away instead of waiting from consumeFrom in the HomeFragment.onCreateView() which will allow the UI to render all at once on its first perform traversal
MarcLeclair
added a commit
to MarcLeclair/fenix
that referenced
this issue
Jun 18, 2020
TopSites will be prefetched with observerOnce (wrapper around observerForever). Also, the SessionControlView.update() is called right away instead of waiting from consumeFrom in the HomeFragment.onCreateView() which will allow the UI to render all at once on its first perform traversal
MarcLeclair
added a commit
to MarcLeclair/fenix
that referenced
this issue
Jun 18, 2020
TopSites will be prefetched with observerOnce (wrapper around observerForever). Also, the SessionControlView.update() is called right away instead of waiting from consumeFrom in the HomeFragment.onCreateView() which will allow the UI to render all at once on its first perform traversal
MarcLeclair
added a commit
that referenced
this issue
Jun 18, 2020
…11668) * For #11660:added prefetch for topsites TopSites will be prefetched with observerOnce (wrapper around observerForever). Also, the SessionControlView.update() is called right away instead of waiting from consumeFrom in the HomeFragment.onCreateView() which will allow the UI to render all at once on its first perform traversal * Removed the submitList(null) since it retriggered a drawing on lower end device
data-sync-user
changed the title
Allow prefetching of topsite with observeForever and allow to update homefragment in onCreateView
FNX3-14803 ⁃ Allow prefetching of topsite with observeForever and allow to update homefragment in onCreateView
Aug 11, 2020
data-sync-user
changed the title
FNX3-14803 ⁃ Allow prefetching of topsite with observeForever and allow to update homefragment in onCreateView
FNX-12636 ⁃ Allow prefetching of topsite with observeForever and allow to update homefragment in onCreateView
Aug 11, 2020
data-sync-user
changed the title
FNX-12636 ⁃ Allow prefetching of topsite with observeForever and allow to update homefragment in onCreateView
FNX2-13557 ⁃ Allow prefetching of topsite with observeForever and allow to update homefragment in onCreateView
Aug 11, 2020
kbrosnan
changed the title
FNX2-13557 ⁃ Allow prefetching of topsite with observeForever and allow to update homefragment in onCreateView
Allow prefetching of topsite with observeForever and allow to update homefragment in onCreateView
Aug 29, 2020
See: #17373 This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Allowing to do so would save us ~100-150ms (time taken on a g5+). Note: the time on higher end device can be between 20-40ms.
I used nanoscope to profile a non debugabble build on start up (simpleperf is still struggling a bit right now so I used this), the UI isn't very friendly and works better on chrome at the moment. At ~1220656473ns in the profile, we can see the
LiveData.setValue()
callback after our first traversal. By prefetching our topsites, we'd be able to avoid this callback and show our topsites on the first layout pass.noprefetch.html.zip
On top of that, we have an issue where we update our UI with the
TopSites
andcollectionStorage
through the callconsumeFrom
which triggers a coroutine. The hiccup here is that thelaunch
isn't triggered right away on our UI thread which means that on our first view traversal, even though our data should be available, we don't update it there which means a slower start up since we have to wait for theconsumeFrom
callback.Here's an image that depics this better. The first call stack on the right is our first traversal (so the firefox logo showing, the url bar on the bottom, etc...). Topsites will then get drawn after the
livedata
callback which occurs where the two lines intersect ( the gray box in the bottom left indicates that this triggers our topsite change withHomeFragment$onTopSiteChange
┆Issue is synchronized with this Jira Task
The text was updated successfully, but these errors were encountered: