summaryrefslogtreecommitdiffstats
path: root/ui/oak
diff options
context:
space:
mode:
authorrlarocque@chromium.org <rlarocque@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-05-28 22:28:54 +0000
committerrlarocque@chromium.org <rlarocque@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-05-28 22:28:54 +0000
commit414df42f095ab7188272918cdc727f10e76bd3c2 (patch)
treef3b21f5256c944eb7dc94d6d44efda76ffcef7fc /ui/oak
parent4e43f0ba3442bbba425435eaf01e61ac7d217afe (diff)
downloadchromium_src-414df42f095ab7188272918cdc727f10e76bd3c2.zip
chromium_src-414df42f095ab7188272918cdc727f10e76bd3c2.tar.gz
chromium_src-414df42f095ab7188272918cdc727f10e76bd3c2.tar.bz2
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 Review URL: https://chromiumcodereview.appspot.com/14667013 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@202673 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/oak')
0 files changed, 0 insertions, 0 deletions