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

Issue 14667013: sync: Better iteration in GenericChangeProcessor (Closed)

Created:
7 years, 7 months ago by rlarocque
Modified:
7 years, 6 months ago
Reviewers:
Nicolas Zea
CC:
chromium-reviews, Raghu Simha, haitaol1, akalin, tim (not reviewing)
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Visibility:
Public.

Description

sync: Better iteration in GenericChangeProcessor This change introduces a new function for fetching the handles of all children of a sync node, then puts it to use in optimizing the GenericChangeProcessor's GetSyncDataForType() function. Prior to the UniquePosition changes, it was simple and cheap to fetch the ID of a successor or predecessor item. After the change, it requires a few expensive map lookups. In other words, GetSuccessorId() has gone from being O(1) to O(lg(n)). This is a especially a problem in code paths where we use GetSuccessorId() to iterate over all nodes in a folder. The UniquePosition change also makes it pretty easy to fetch all child nodes under a given parent. We could easily return all the EntryKernels under a given folder. Unfortunately, the APIs don't make it easy to expose that functionality. Instead, we do something less efficient, but still much better than the status quo: return the IDs of all the children. The caller will need to look up each entry at O(lg(n)) cost, but at least it didn't have to do two lookups to fetch each ID. This change should lead to a slight performance improvement in the ModelAssociation time of types that use the GenericChangeProcessor. BUG=178275, 241813 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=202673

Patch Set 1 #

Patch Set 2 : Undo unnecessary change #

Total comments: 10

Patch Set 3 : Review fixes #

Unified diffs Side-by-side diffs Delta from patch set Stats (+135 lines, -4 lines) Patch
M chrome/browser/sync/glue/generic_change_processor.cc View 2 chunks +6 lines, -4 lines 0 comments Download
A chrome/browser/sync/glue/generic_change_processor_unittest.cc View 1 2 1 chunk +109 lines, -0 lines 0 comments Download
M chrome/chrome_tests_unit.gypi View 1 2 1 chunk +1 line, -0 lines 0 comments Download
M sync/internal_api/base_node.cc View 1 chunk +4 lines, -0 lines 0 comments Download
M sync/internal_api/public/base_node.h View 1 2 1 chunk +5 lines, -0 lines 0 comments Download
M sync/syncable/entry.h View 1 2 1 chunk +6 lines, -0 lines 0 comments Download
M sync/syncable/entry.cc View 1 chunk +4 lines, -0 lines 0 comments Download

Messages

Total messages: 8 (0 generated)
rlarocque
Please review.
7 years, 7 months ago (2013-05-17 22:08:23 UTC) #1
rlarocque
On 2013/05/17 22:08:23, rlarocque wrote: > Please review. ping.
7 years, 7 months ago (2013-05-21 18:01:31 UTC) #2
Nicolas Zea
mostly nits https://codereview.chromium.org/14667013/diff/2001/chrome/browser/sync/glue/generic_change_processor_unittest.cc File chrome/browser/sync/glue/generic_change_processor_unittest.cc (right): https://codereview.chromium.org/14667013/diff/2001/chrome/browser/sync/glue/generic_change_processor_unittest.cc#newcode24 chrome/browser/sync/glue/generic_change_processor_unittest.cc:24: class GenericChangeProcessorTest : public testing::Test { put ...
7 years, 7 months ago (2013-05-22 22:34:02 UTC) #3
rlarocque
Rebased and addressed review comments. PTAL. https://codereview.chromium.org/14667013/diff/2001/chrome/browser/sync/glue/generic_change_processor_unittest.cc File chrome/browser/sync/glue/generic_change_processor_unittest.cc (right): https://codereview.chromium.org/14667013/diff/2001/chrome/browser/sync/glue/generic_change_processor_unittest.cc#newcode24 chrome/browser/sync/glue/generic_change_processor_unittest.cc:24: class GenericChangeProcessorTest : ...
7 years, 7 months ago (2013-05-23 00:39:39 UTC) #4
rlarocque
On 2013/05/23 00:39:39, rlarocque wrote: > Rebased and addressed review comments. PTAL. > > https://codereview.chromium.org/14667013/diff/2001/chrome/browser/sync/glue/generic_change_processor_unittest.cc ...
7 years, 6 months ago (2013-05-28 18:16:31 UTC) #5
Nicolas Zea
lgtm
7 years, 6 months ago (2013-05-28 18:17:17 UTC) #6
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/rlarocque@chromium.org/14667013/10001
7 years, 6 months ago (2013-05-28 18:24:03 UTC) #7
commit-bot: I haz the power
7 years, 6 months ago (2013-05-28 22:28:55 UTC) #8
Message was sent while issue was closed.
Change committed as 202673

Powered by Google App Engine
This is Rietveld 408576698