Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(422)

Issue 1008103002: Sync: Avoid 3 passes over SyncDarta DB when loading the directory from the disk (Closed)

Created:
5 years, 9 months ago by stanisc
Modified:
5 years, 9 months ago
Reviewers:
Nicolas Zea
CC:
chromium-reviews, tim+watch_chromium.org, pvalenzuela+watch_chromium.org, maxbogue+watch_chromium.org, zea+watch_chromium.org, maniscalco+watch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Sync: Avoid 3 passes over SyncDarta DB when loading the directory from the disk According to profiling the first two read passes over SyncData DB are from DirectoryBackingStore::DropDeletedEntries. This function executes two SQL queries that drop entries pending deletion. Since it is uncommon to have entries pending deletion it is far more efficient to remove DirectoryBackingStore::DropDeletedEntries and instead check for the entries matching this criteria inside DirectoryBackingStore::LoadEntries, skip those entries from being loaded and put them straight into Directory's metahandles_to_purge collection which sets them up for deletion during a subsequent database save. See the bug for the preliminary performance results. BUG=464073 Committed: https://crrev.com/a3ed68bbb72ec9fdf16d866f41cb0951d006088b Cr-Commit-Position: refs/heads/master@{#320861}

Patch Set 1 #

Total comments: 1

Patch Set 2 : Added unit test #

Total comments: 2

Patch Set 3 : Addressed CR feedback. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+188 lines, -75 lines) Patch
M sync/syncable/deferred_on_disk_directory_backing_store.h View 1 chunk +1 line, -0 lines 0 comments Download
M sync/syncable/deferred_on_disk_directory_backing_store.cc View 2 chunks +2 lines, -1 line 0 comments Download
M sync/syncable/deferred_on_disk_directory_backing_store_unittest.cc View 6 chunks +9 lines, -6 lines 0 comments Download
M sync/syncable/directory.h View 1 1 chunk +3 lines, -2 lines 0 comments Download
M sync/syncable/directory.cc View 3 chunks +8 lines, -4 lines 0 comments Download
M sync/syncable/directory_backing_store.h View 2 chunks +9 lines, -8 lines 0 comments Download
M sync/syncable/directory_backing_store.cc View 3 chunks +17 lines, -18 lines 0 comments Download
M sync/syncable/directory_backing_store_unittest.cc View 7 chunks +30 lines, -17 lines 0 comments Download
M sync/syncable/directory_unittest.cc View 1 2 1 chunk +81 lines, -0 lines 0 comments Download
M sync/syncable/in_memory_directory_backing_store.h View 1 chunk +1 line, -0 lines 0 comments Download
M sync/syncable/in_memory_directory_backing_store.cc View 2 chunks +2 lines, -3 lines 0 comments Download
M sync/syncable/invalid_directory_backing_store.h View 1 chunk +1 line, -0 lines 0 comments Download
M sync/syncable/invalid_directory_backing_store.cc View 1 chunk +1 line, -0 lines 0 comments Download
M sync/syncable/mutable_entry.cc View 1 1 chunk +3 lines, -3 lines 0 comments Download
M sync/syncable/on_disk_directory_backing_store.h View 1 chunk +5 lines, -4 lines 0 comments Download
M sync/syncable/on_disk_directory_backing_store.cc View 4 chunks +6 lines, -5 lines 0 comments Download
M sync/test/test_directory_backing_store.h View 1 chunk +2 lines, -1 line 0 comments Download
M sync/test/test_directory_backing_store.cc View 2 chunks +7 lines, -3 lines 0 comments Download

Messages

Total messages: 10 (3 generated)
Nicolas Zea
This looks good. Two questions: where are we now doing the actual purging of those ...
5 years, 9 months ago (2015-03-16 19:33:36 UTC) #2
stanisc
On 2015/03/16 19:33:36, Nicolas Zea wrote: > This looks good. Two questions: where are we ...
5 years, 9 months ago (2015-03-16 20:43:50 UTC) #3
stanisc
Added a unit test that verifies purging of deleted entries. Added performance results to the ...
5 years, 9 months ago (2015-03-17 00:54:48 UTC) #4
Nicolas Zea
LGTM https://codereview.chromium.org/1008103002/diff/20001/sync/syncable/directory_unittest.cc File sync/syncable/directory_unittest.cc (right): https://codereview.chromium.org/1008103002/diff/20001/sync/syncable/directory_unittest.cc#newcode559 sync/syncable/directory_unittest.cc:559: const int CLIENT_COUNT = 2; nit: const variables ...
5 years, 9 months ago (2015-03-17 01:05:17 UTC) #5
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1008103002/40001
5 years, 9 months ago (2015-03-17 04:37:02 UTC) #8
commit-bot: I haz the power
Committed patchset #3 (id:40001)
5 years, 9 months ago (2015-03-17 04:40:30 UTC) #9
commit-bot: I haz the power
5 years, 9 months ago (2015-03-17 04:41:04 UTC) #10
Message was sent while issue was closed.
Patchset 3 (id:??) landed as
https://crrev.com/a3ed68bbb72ec9fdf16d866f41cb0951d006088b
Cr-Commit-Position: refs/heads/master@{#320861}

Powered by Google App Engine
This is Rietveld 408576698