fenix icon indicating copy to clipboard operation
fenix copied to clipboard

bookmarksStorage.getBookmarksWithUrl takes unexpectedly long time (10 - 50ms)

Open mcomella opened this issue 7 years ago • 5 comments

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

mcomella avatar Oct 31 '19 21:10 mcomella

Actions

  1. Get median #, p90 of bookmarks that real mobile users have. Is this expected to change with new versions of Fenix? @ecsmyth
  2. Where is this called from within Fenix? That will determine how we prioritize. @hawkinsw

hawkinsw avatar Nov 05 '19 20:11 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.

mcomella avatar Dec 27 '19 16:12 mcomella

Based on @mcomella's comment, I'm dropping the priority to P2 to align with proposed performance release criteria.

ecsmyth avatar Jan 06 '20 17:01 ecsmyth

Fenix uses the P* labels, not us, so replacing the label and sending back to triage.

mcomella avatar Jan 06 '20 19:01 mcomella

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.

stale[bot] avatar Feb 04 '21 23:02 stale[bot]