Skip to content
This repository has been archived by the owner. It is now read-only.

Optimize URL bar history and bookmark suggestions (generateNewSuggestionsList()) #8692

Merged
merged 1 commit into from May 4, 2017

Conversation

@ayumi
Copy link
Contributor

ayumi commented May 4, 2017

Related to #7453

With 10,000 sites, time to run generateNewSuggestionsList():

  • Autocomplete history and bookmarks Enabled:
    • Existing (33e3fca): 170 ms
    • New: 38 ms
  • Autocomplete history and bookmarks Disabled:
    • Existing: 120 ms
    • New: 3 ms

Auditors: @darkdh @bbondy

  • Submitted a ticket for my issue if one did not already exist.
  • Used Github auto-closing keywords in the commit message.
  • Added/updated tests for this change (for new code or code which already has tests).
  • Ran git rebase -i to squash commits (if needed).

Test Plan:

  • Run tests: npm run test -- --grep="^urlBarSuggestions"
@ayumi ayumi requested review from bbondy and darkdh May 4, 2017
@ayumi ayumi changed the title Optimize URL bar history and bookmark suggestions Optimize URL bar history and bookmark suggestions (generateNewSuggestionsList()) May 4, 2017
@NejcZdovc NejcZdovc added this to the 0.15.3 milestone May 4, 2017
@ayumi ayumi force-pushed the fix/url-bar-autocomplete branch 2 times, most recently from c3fadb9 to e019197 May 4, 2017
@ayumi ayumi self-assigned this May 4, 2017
let bookmarkSites = new Immutable.List()
const sites = appStoreRenderer.state.get('sites')
sites.forEach(site => {
if (!sitesFilter(site)) {

This comment has been minimized.

Copy link
@ayumi

ayumi May 4, 2017

Author Contributor

Note for reviewers: this is most important change, to filter out non-matching sites as soon as possible to avoid downstream property lookup

return false
}
const title = site.get('title')
return location.toLowerCase().includes(urlLocationLower) ||

This comment has been minimized.

Copy link
@bsclifton

bsclifton May 4, 2017

Member

Per our discussion on Slack, I wonder if this could be sped up using indexOf? Link you shared: https://jsperf.com/regexp-test-vs-string-includes-vs-string-indexof

This comment has been minimized.

Copy link
@ayumi

ayumi May 4, 2017

Author Contributor

thanks! i've updated this PR to use indexOf instead of includes.

Related to #7453

Auditors: @bsclifton @bbondy
@ayumi ayumi force-pushed the fix/url-bar-autocomplete branch from e019197 to 90c5b2d May 4, 2017
@darkdh
darkdh approved these changes May 4, 2017
Copy link
Member

darkdh left a comment

lgtm

@ayumi ayumi merged commit c002e3f into master May 4, 2017
0 of 2 checks passed
0 of 2 checks passed
continuous-integration/appveyor/pr AppVeyor build failed
Details
continuous-integration/travis-ci/pr The Travis CI build failed
Details
@ayumi ayumi deleted the fix/url-bar-autocomplete branch May 4, 2017
@bsclifton

This comment has been minimized.

Copy link
Member

bsclifton commented on 90c5b2d May 7, 2017

++

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

4 participants
You can’t perform that action at this time.