bookmarksStorage.getBookmarksWithUrl takes unexpectedly long time (10 - 50ms)
Severin mentioned to me that:
bookmarksStorage.getBookmarksWithUrl(session.url).firstOrNull { it.url == session.url }
(source) takes anywhere from 10-50 MS in a unit test even if there are a small number of bookmarks, like 4: this is an unexpectedly long time.
We should investigate possible causes.
I wonder if the unit test call sthis before the DB is initialized (e.g. initial data creation, or even just loading the DB from disk) so calling this sets up the DB and is what makes this take a long time, but we wouldn't see this in practice.
┆Issue is synchronized with this Jira Task
Actions
- Get median #, p90 of bookmarks that real mobile users have. Is this expected to change with new versions of Fenix? @ecsmyth
- Where is this called from within Fenix? That will determine how we prioritize. @hawkinsw
Where is this called from within Fenix? That will determine how we prioritize.
@ecsmyth This is called when:
- The URL changes (to update the internal "isUrlBookmarked"? state). This occurs off the main thread.
- The user taps the bookmark star in the 3-dot menu (to determine if we should go directly to the "edit" screen or if we should save and then go to the "edit"). This occurs off the main thread and there is a brief delay before displaying the appropriate UI element.
Since this happens off the main thread, I think it's probably unimportant.
Based on @mcomella's comment, I'm dropping the priority to P2 to align with proposed performance release criteria.
Fenix uses the P* labels, not us, so replacing the label and sending back to triage.
See: https://github.com/mozilla-mobile/fenix/issues/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.