Skip to content
This repository has been archived by the owner on Dec 11, 2019. It is now read-only.

URL bar, on every keystroke the browser re-checks if the current location is bookmarked #8703

Closed
ayumi opened this issue May 4, 2017 · 1 comment

Comments

@ayumi
Copy link
Contributor

ayumi commented May 4, 2017

Test plan

#8894 (comment)


With 10,000 bookmarks, this adds 80ms to every keystroke.

  • Did you search for similar issues before submitting this one?
    Yes

  • Describe the issue you encountered:

  • Platform (Win7, 8, 10? macOS? Linux distro?):

  • Brave Version (revision SHA):

  • Steps to reproduce:

    1. Instrument siteUtil.isSiteBookmarked() by adding to the beginning const startTime = new Date().getTime() and to the end console.log(isSiteBookmarked() ${new Date().getTime() - startTime}).
    2. Start a new profile and import 10,000 bookmarks.
    3. Type in the URL bar and observe logs.
  • Actual result:
    2 calls for 40 ms / keystroke

  • Expected result:
    No calls. (It should only check if the location changes.)

  • Will the steps above reproduce in a fresh profile? If not what other info can be added?
    Yes

  • Is this an issue in the currently released version?
    Yes

  • Can this issue be consistently reproduced?
    Yes

  • Extra QA steps:

    1. The "forsaken" sync group has a lot of bookmarks. It might help you if you're testing.
  • Any related issues:
    Performance : urlbar response is slow when searching across many bookmarks #7453

@bbondy
Copy link
Member

bbondy commented May 18, 2017

a faster way to fix this would be to move the component into it's own React component and only pass in the location and not the state about url input to that control. Then it would only check when the actual page url changes.

@ayumi that might be a .300 fix to do instead if you think yours is too risky this late in the game. And keep the current fix you have for .400.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.