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

Issue 2591533002: cc: Change RTree nodes container to be a vector (with reserve). (Closed)

Created:
4 years ago by vmpstr
Modified:
4 years ago
Reviewers:
danakj, DmitrySkiba
CC:
chromium-reviews, cc-bugs_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

cc: Change RTree nodes container to be a vector (with reserve). This patch changes the nodes container in the rtree to use a vector. In order to preserve the consistent access to elements, it reserves the vector to the needed capacity. The wasted space is <= 6 elements. Added a unittest to verify the reserve path is correct for up to 1000 rects. However, locally I've tested this for up to 520k rects (and still testing for up to 1m rects). The perf results from N7v2 are below. Before the patch: [ RUN ] RTreePerfTest.Construct *RESULT rtree_construct: 100= 75723.8671875 runs/s *RESULT rtree_construct: 1000= 11985 runs/s *RESULT rtree_construct: 10000= 715.2415161132812 runs/s *RESULT rtree_construct: 100000= 54.19050216674805 runs/s [ OK ] RTreePerfTest.Construct (8243 ms) [ RUN ] RTreePerfTest.Search *RESULT rtree_search: 100= 352105 runs/s *RESULT rtree_search: 1000= 97542.0234375 runs/s *RESULT rtree_search: 10000= 10274.0595703125 runs/s *RESULT rtree_search: 100000= 866.167236328125 runs/s [ OK ] RTreePerfTest.Search (8122 ms) After the patch: [ RUN ] RTreePerfTest.Construct *RESULT rtree_construct: 100= 112420 runs/s (+48%) *RESULT rtree_construct: 1000= 13482.32421875 runs/s (+12%) *RESULT rtree_construct: 10000= 666.6328125 runs/s (-7%) *RESULT rtree_construct: 100000= 55.98017501831055 runs/s (+3%) [ OK ] RTreePerfTest.Construct (8340 ms) [ RUN ] RTreePerfTest.Search *RESULT rtree_search: 100= 365225 runs/s *RESULT rtree_search: 1000= 98002.0078125 runs/s *RESULT rtree_search: 10000= 10344.048828125 runs/s *RESULT rtree_search: 100000= 866.0883178710938 runs/s [ OK ] RTreePerfTest.Search (8092 ms) BUG=674169 R=danakj@chromium.org, dskiba@chromium.org CQ_INCLUDE_TRYBOTS=master.tryserver.blink:linux_trusty_blink_rel Committed: https://crrev.com/b80d44193d48fb38e2fffa7c3f16d89979351371 Cr-Commit-Position: refs/heads/master@{#439686}

Patch Set 1 #

Patch Set 2 : cont: update #

Total comments: 6

Patch Set 3 : comments #

Patch Set 4 : compile fix #

Unified diffs Side-by-side diffs Delta from patch set Stats (+51 lines, -14 lines) Patch
M cc/base/rtree.h View 1 2 3 5 chunks +23 lines, -4 lines 0 comments Download
M cc/base/rtree.cc View 1 2 3 chunks +14 lines, -10 lines 0 comments Download
M cc/base/rtree_unittest.cc View 1 2 1 chunk +14 lines, -0 lines 0 comments Download

Messages

Total messages: 22 (13 generated)
vmpstr
Behold, a patch!
4 years ago (2016-12-19 21:57:30 UTC) #2
danakj
LGTM https://codereview.chromium.org/2591533002/diff/20001/cc/base/rtree.cc File cc/base/rtree.cc (right): https://codereview.chromium.org/2591533002/diff/20001/cc/base/rtree.cc#newcode24 cc/base/rtree.cc:24: // existing nodes, so verify that capacity < ...
4 years ago (2016-12-19 22:20:50 UTC) #3
danakj
Whats the wasted space now in the scenarios from the bug?
4 years ago (2016-12-19 22:22:37 UTC) #4
vmpstr
https://codereview.chromium.org/2591533002/diff/20001/cc/base/rtree.cc File cc/base/rtree.cc (right): https://codereview.chromium.org/2591533002/diff/20001/cc/base/rtree.cc#newcode24 cc/base/rtree.cc:24: // existing nodes, so verify that capacity < size. ...
4 years ago (2016-12-19 22:51:27 UTC) #6
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2591533002/40001
4 years ago (2016-12-19 23:26:18 UTC) #12
commit-bot: I haz the power
Try jobs failed on following builders: win_chromium_compile_dbg_ng on master.tryserver.chromium.win (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.win/builders/win_chromium_compile_dbg_ng/builds/317867)
4 years ago (2016-12-20 00:29:56 UTC) #14
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2591533002/60001
4 years ago (2016-12-20 00:55:59 UTC) #17
commit-bot: I haz the power
Committed patchset #4 (id:60001)
4 years ago (2016-12-20 03:05:31 UTC) #20
commit-bot: I haz the power
4 years ago (2016-12-20 03:08:25 UTC) #22
Message was sent while issue was closed.
Patchset 4 (id:??) landed as
https://crrev.com/b80d44193d48fb38e2fffa7c3f16d89979351371
Cr-Commit-Position: refs/heads/master@{#439686}

Powered by Google App Engine
This is Rietveld 408576698