Skip to content
This repository has been archived by the owner on Nov 1, 2022. It is now read-only.

Thumbnail changes update the tabs tray too often #7313

Closed
jonalmeida opened this issue Jun 9, 2020 · 2 comments · Fixed by #7356
Closed

Thumbnail changes update the tabs tray too often #7313

jonalmeida opened this issue Jun 9, 2020 · 2 comments · Fixed by #7356
Assignees
Labels
🐞 bug Something isn't working performance Performance related issues <tabs> Components: browser-tabstray, feature-tabs <thumbnails> Components: browser-thumbnails

Comments

@jonalmeida
Copy link
Contributor

jonalmeida commented Jun 9, 2020

When we update the tabs tray, we use the generationId from the bitmap to identify if the thumbnails have changed. It turns out that these are not stable (probably because we're compressing the images so the ID changes).

We need a better way to avoid the whole tray from updating when we have a thumbnail update.

┆Issue is synchronized with this Jira Task

@jonalmeida jonalmeida added 🐞 bug Something isn't working <tabs> Components: browser-tabstray, feature-tabs <thumbnails> Components: browser-thumbnails labels Jun 9, 2020
@jonalmeida jonalmeida self-assigned this Jun 9, 2020
@jonalmeida
Copy link
Contributor Author

jonalmeida commented Jun 11, 2020

I verified that removing the generationId from Tabs.equals causes the multiple refreshes.

In mozilla-mobile/fenix#11185 (comment), I mentioned we should try to use the loadToView mechanism to show the icons safely. I now think that's probably the best way forward for this problem too. It would solve:

  • The initial case where you want to load the initial image from the disk.
  • We can remove the use case mapping from the TabsTrayPresenter
  • For thumbnail updates, we forward the new thumbnails into the presenter and save them async for the next time we need to load fresh thumbnails from disk.

What changes though is the surface area of this API for the consumer to load the thumbnails where ever the caller needs.

More concretely, the ThumbnailsStorage should add a method like loadIntoView and call that on the viewholder when binding, and update the viewholder as well if new changes come from the store.

jonalmeida added a commit to jonalmeida/android-components that referenced this issue Jun 12, 2020
We were seeing odd bugs and performance issues from trying to map the
disk cache into the TabsTrayPresenter.

A better solution, would be to load the thumbnails straight from the
cache, and incremental updates via the store.
jonalmeida added a commit to jonalmeida/android-components that referenced this issue Jun 12, 2020
jonalmeida added a commit to jonalmeida/android-components that referenced this issue Jun 12, 2020
We were seeing odd bugs and performance issues from trying to map the
disk cache into the TabsTrayPresenter.

A better solution, would be to load the thumbnails straight from the
cache, and incremental updates via the store.
jonalmeida added a commit to jonalmeida/android-components that referenced this issue Jun 12, 2020
jonalmeida added a commit to jonalmeida/android-components that referenced this issue Jun 12, 2020
@jonalmeida jonalmeida linked a pull request Jun 12, 2020 that will close this issue
4 tasks
jonalmeida added a commit to jonalmeida/android-components that referenced this issue Jun 12, 2020
We were seeing odd bugs and performance issues from trying to map the
disk cache into the TabsTrayPresenter.

A better solution, would be to load the thumbnails straight from the
cache, and incremental updates via the store.
jonalmeida added a commit to jonalmeida/android-components that referenced this issue Jun 12, 2020
jonalmeida added a commit to jonalmeida/android-components that referenced this issue Jun 12, 2020
jonalmeida added a commit to jonalmeida/android-components that referenced this issue Jun 12, 2020
We were seeing odd bugs and performance issues from trying to map the
disk cache into the TabsTrayPresenter.

A better solution, would be to load the thumbnails straight from the
cache, and incremental updates via the store.
jonalmeida added a commit to jonalmeida/android-components that referenced this issue Jun 12, 2020
jonalmeida added a commit to jonalmeida/android-components that referenced this issue Jun 12, 2020
jonalmeida added a commit to jonalmeida/android-components that referenced this issue Jun 12, 2020
jonalmeida added a commit to jonalmeida/android-components that referenced this issue Jun 12, 2020
bors bot pushed a commit that referenced this issue Jun 12, 2020
7356: Issue #7313: Use ThumbnailLoader for the TabViewHolder r=gabrielluong,boek a=jonalmeida

Instead of trying to inline the thumbnail images from disk into the TabsTrayPresenter, we can load them from the `ThumbnailStorage` via the `ThumbnailLoader` and rely on the `TabsTrayPresenter` to consume new thumbnail updates only from the store.

This fixes some perf issues, inconsistencies, and duplicate updates to the tabs tray.



Co-authored-by: Jonathan Almeida <[email protected]>
@bors bors bot closed this as completed in 0a95c91 Jun 12, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
🐞 bug Something isn't working performance Performance related issues <tabs> Components: browser-tabstray, feature-tabs <thumbnails> Components: browser-thumbnails
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants