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

Reduce redundant siteSort to sort once and used everywhere #8075

Merged
merged 1 commit into from
Jun 13, 2017
Merged

Conversation

darkdh
Copy link
Member

@darkdh darkdh commented Apr 5, 2017

fix #7240

Auditors: @bbondy, @bsclifton

Test Plan:

  1. Import bunch of bookmarks
  2. Open bookmarks of menu shouldn't affect performance
  3. Open about:bookmarks shouldn't affect performance
  • 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).

@bbondy
Copy link
Member

bbondy commented Apr 17, 2017

++ please rebase and merge

@darkdh
Copy link
Member Author

darkdh commented Apr 17, 2017

rebased. please review again.

const d = diff(lastEmittedState, appState)
// diff and patch will make map out of order so toList() is to maintain
// sites map order
const diffAppState = appState.set('sites', appState.get('sites').toList())
Copy link
Member Author

@darkdh darkdh Apr 18, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need a better way to deal with the out of order.
This will cause significant slowness

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

☹️

@bsclifton
Copy link
Member

@darkdh is this still a WIP? Sorry for not reviewing earlier ☹️

@darkdh
Copy link
Member Author

darkdh commented Apr 29, 2017

sorry, this is waiting for shared app state change landed

@NejcZdovc
Copy link
Contributor

let's wait for tests, but on a first glance it looks good to me

@darkdh
Copy link
Member Author

darkdh commented May 31, 2017

There are two failed test I need to look into

  1. tab tests tab order with pinned tabs sequentially by default
  2. sitesReducerTest APP_MOVE_SITE Moves the specified site

@darkdh
Copy link
Member Author

darkdh commented May 31, 2017

fix sitesReducerTest APP_MOVE_SITE Moves the specified site
and tab tests tab order with pinned tabs sequentially by default runs correctly on my local env

@@ -149,8 +149,8 @@ describe('sitesReducerTest', function () {
moveAction.prepend = true
newState = sitesReducer(Immutable.fromJS(newState), moveAction).toJS()
assert.equal(Object.keys(newState.sites).length, 3)
assert.equal(Object.values(newState.sites)[2].location, url)
assert.equal(Object.values(newState.sites)[2].order, 1)
assert.equal(Object.values(newState.sites)[1].location, url)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this correct change, because the comment at the top states that site should be at the third position (2), but you changed this value to 1

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, we will sort sites after ADD, REMOVE, MOVE in this PR

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this is correct then I would add some description about it beside this comment, otherwise it could be confusing

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

comment added

@bbondy
Copy link
Member

bbondy commented Jun 11, 2017

Please rebase again @darkdh
Thanks!

@darkdh
Copy link
Member Author

darkdh commented Jun 11, 2017

@bbondy, rebased!

fix #7240

Auditors: @bbondy, @bsclifton

Test Plan:
1. Import bunch of bookmarks
2. Open bookmarks of menu shouldn't affect performance
3. Open about:bookmarks shouldn't affect performance
@bbondy bbondy merged commit 7ce06ee into master Jun 13, 2017
bbondy added a commit that referenced this pull request Jun 13, 2017
Reduce redundant siteSort to sort once and used everywhere
bbondy added a commit that referenced this pull request Jun 13, 2017
Reduce redundant siteSort to sort once and used everywhere
darkdh added a commit that referenced this pull request Jun 13, 2017
NejcZdovc pushed a commit that referenced this pull request Jun 13, 2017
NejcZdovc pushed a commit that referenced this pull request Jun 13, 2017
@bsclifton bsclifton deleted the 7240 branch June 14, 2017 05:41
bridiver pushed a commit that referenced this pull request Jun 14, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Browser performance reduces when large amount of bookmarks are imported
6 participants