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

apply sync records in batches #7308

Closed
diracdeltas opened this issue Feb 17, 2017 · 0 comments · Fixed by #7309
Closed

apply sync records in batches #7308

diracdeltas opened this issue Feb 17, 2017 · 0 comments · Fixed by #7309

Comments

@diracdeltas
Copy link
Member

diracdeltas commented Feb 17, 2017

Test plan:

#7309 (comment)


testers found that a huge sync update (over 6000 bookmarks) locks up the UI and causes huge memory usage. i noticed that this is not a problem at all for bookmarks import, which calls appActions.addSite(Immutable.fromJS(sites)) (for sites.length > 6000). this suggests that the issue is that we are calling appActions.addSite for one site at a time instead of in a batch.

we should sort sync records in applySyncRecords and apply them in batches. naively, i would sort things by objectData type, then apply all the CREATEs for a given type, then all the UPDATES, then all the DELETEs. cc @ayumi

@diracdeltas diracdeltas added this to the 0.13.5 milestone Feb 17, 2017
@diracdeltas diracdeltas self-assigned this Feb 17, 2017
diracdeltas added a commit that referenced this issue Feb 18, 2017
fix #7308

Auditors: @ayumi @alexwykoff

Test Plan:
1. in js/constants/appConfig, change 'isProduction' to true
2. in about:preferences#sync, choose the 'i have an existing sync code' option. enter in the code words that Alex posted in #testers (starts with 'forsaken')
3. open about:bookmarks and wait for 6000+ bookmarks to be synced. the browser should not freeze or use excessive memory during the sync.
diracdeltas added a commit that referenced this issue Feb 23, 2017
fix #7308

Auditors: @ayumi @alexwykoff

Test Plan:
1. in js/constants/appConfig, change 'isProduction' to true
2. in about:preferences#sync, choose the 'i have an existing sync code' option. enter in the code words that Alex posted in #testers (starts with 'forsaken')
3. open about:bookmarks and wait for 6000+ bookmarks to be synced. the browser should not freeze or use excessive memory during the sync.
diracdeltas added a commit that referenced this issue Feb 24, 2017
fix #7308
fix #7293
fix #7307

Auditors: @ayumi @alexwykoff

Test Plan:
1. in about:preferences#sync, choose the 'i have an existing sync code' option. enter in the code words that Alex posted in #testers (starts with 'forsaken')
2. wait for 6000+ bookmarks to appear in the bookmarks toolbar. the browser should not freeze or use excessive memory during the sync. for me it takes about 5 seconds.
3. open about:bookmarks. you should see a bunch of folders with bookmarks, including subfolders.
diracdeltas added a commit that referenced this issue Feb 24, 2017
fix #7308
fix #7293
fix #7307

Auditors: @ayumi @alexwykoff

Test Plan:
1. in about:preferences#sync, choose the 'i have an existing sync code' option. enter in the code words that Alex posted in #testers (starts with 'forsaken')
2. wait for 6000+ bookmarks to appear in the bookmarks toolbar. the browser should not freeze or use excessive memory during the sync. for me it takes about 5 seconds.
3. open about:bookmarks. you should see a bunch of folders with bookmarks, including subfolders.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.