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

Issue 15322003: sync: Count nodes more efficiently (Closed)

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

Description

sync: Count nodes more efficiently The GetTotalNodesCount() function is called sufficiently often that it makes sense to spend some effort optimizing its implementation. The current implementation uses some traversal functions that are fairly slow, especially since GetSuccessorId() was made more expensive by the implementation of UniquePositions. This change moves the implementation into the syncable::Directory. This allows it to take advantage of the Directory's internal data structures and avoid unnecessary lookups. BUG=248143, 238621 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=202973

Patch Set 1 #

Patch Set 2 : Non-recursive version #

Patch Set 3 : Remove cbegin/cend references to fix compile #

Total comments: 7

Patch Set 4 : Implement suggestions from review #

Unified diffs Side-by-side diffs Delta from patch set Stats (+55 lines, -25 lines) Patch
M sync/internal_api/base_node.cc View 1 2 3 1 chunk +1 line, -25 lines 0 comments Download
M sync/syncable/directory.h View 1 2 3 2 chunks +9 lines, -0 lines 0 comments Download
M sync/syncable/directory.cc View 1 2 3 1 chunk +40 lines, -0 lines 0 comments Download
M sync/syncable/entry.h View 1 chunk +1 line, -0 lines 0 comments Download
M sync/syncable/entry.cc View 1 chunk +4 lines, -0 lines 0 comments Download

Messages

Total messages: 7 (0 generated)
rlarocque
Please review. https://codereview.chromium.org/15322003/diff/3001/sync/syncable/directory.cc File sync/syncable/directory.cc (right): https://codereview.chromium.org/15322003/diff/3001/sync/syncable/directory.cc#newcode348 sync/syncable/directory.cc:348: void Directory::GetTotalNodeCountImpl( This is the main reason ...
7 years, 7 months ago (2013-05-21 00:09:06 UTC) #1
rlarocque
Re-assigning to Nicolas because Tim will be OOO for a while. The original review message ...
7 years, 6 months ago (2013-05-28 18:22:58 UTC) #2
Nicolas Zea
https://codereview.chromium.org/15322003/diff/3001/sync/syncable/directory.cc File sync/syncable/directory.cc (right): https://codereview.chromium.org/15322003/diff/3001/sync/syncable/directory.cc#newcode324 sync/syncable/directory.cc:324: int Directory::GetTotalNodeCount( this seems complex enough to warrant a ...
7 years, 6 months ago (2013-05-28 22:12:39 UTC) #3
rlarocque
PTAL. https://codereview.chromium.org/15322003/diff/3001/sync/syncable/directory.cc File sync/syncable/directory.cc (right): https://codereview.chromium.org/15322003/diff/3001/sync/syncable/directory.cc#newcode324 sync/syncable/directory.cc:324: int Directory::GetTotalNodeCount( On 2013/05/28 22:12:39, Nicolas Zea wrote: ...
7 years, 6 months ago (2013-05-29 19:01:13 UTC) #4
Nicolas Zea
lgtm
7 years, 6 months ago (2013-05-29 19:02:30 UTC) #5
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/rlarocque@chromium.org/15322003/13001
7 years, 6 months ago (2013-05-29 19:03:50 UTC) #6
commit-bot: I haz the power
7 years, 6 months ago (2013-05-29 21:18:33 UTC) #7
Message was sent while issue was closed.
Change committed as 202973

Powered by Google App Engine
This is Rietveld 408576698