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

Issue 2776793002: Make flat containers stable, allow constructing from vector. (Closed)

Created:
3 years, 9 months ago by brettw
Modified:
3 years, 8 months ago
Reviewers:
danakj, dyaroshev
CC:
chromium-reviews, vmpstr+watch_chromium.org
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

Make flat containers stable, allow constructing from vector. The stability matters more for maps that it did for sets, so I think it makes sense if all of the flat_set/map containers are stable sorted. Since we are unlikely to switch out the storage type, I made constructors that take a moved vector. I want to use this pattern to collect base::Values and then construct a map from it all at once. Review-Url: https://codereview.chromium.org/2776793002 Cr-Commit-Position: refs/heads/master@{#463094} Committed: https://chromium.googlesource.com/chromium/src/+/5c72fdadcbe0e5914a2a1c935992975e31ff3e67

Patch Set 1 #

Patch Set 2 : Comment update #

Patch Set 3 : Checkpoint #

Total comments: 6

Patch Set 4 : Update #

Patch Set 5 : Comments #

Patch Set 6 : . #

Patch Set 7 : A few more fixes #

Patch Set 8 : More #

Patch Set 9 : GCC fixes #

Patch Set 10 : Merge #

Total comments: 25

Patch Set 11 : Review comments #

Patch Set 12 : Move to internal #

Patch Set 13 : Put back media log change lost in merge #

Unified diffs Side-by-side diffs Delta from patch set Stats (+397 lines, -142 lines) Patch
M base/containers/flat_map.h View 1 2 3 4 5 6 7 8 9 10 6 chunks +30 lines, -6 lines 0 comments Download
M base/containers/flat_map_unittest.cc View 1 2 3 4 5 6 7 2 chunks +42 lines, -9 lines 0 comments Download
M base/containers/flat_set.h View 1 2 3 4 5 6 7 8 9 10 6 chunks +19 lines, -13 lines 0 comments Download
M base/containers/flat_set_unittest.cc View 1 2 3 4 5 6 7 2 chunks +5 lines, -4 lines 0 comments Download
M base/containers/flat_tree.h View 1 2 3 4 5 6 7 8 9 10 11 12 8 chunks +75 lines, -18 lines 0 comments Download
M base/containers/flat_tree_unittest.cc View 1 2 3 4 5 6 7 38 chunks +189 lines, -60 lines 0 comments Download
M components/omnibox/browser/in_memory_url_index_types.cc View 1 2 3 4 5 6 7 2 chunks +3 lines, -2 lines 0 comments Download
M components/omnibox/browser/url_index_private_data.cc View 1 2 3 4 5 6 7 8 9 10 11 12 3 chunks +6 lines, -3 lines 0 comments Download
M media/base/media_log.cc View 1 2 3 4 5 6 7 8 9 11 12 1 chunk +28 lines, -27 lines 0 comments Download

Messages

Total messages: 101 (40 generated)
brettw
I went to try to use this efficiently and ran into a problem where the ...
3 years, 9 months ago (2017-03-24 22:51:13 UTC) #2
brettw
Comment update
3 years, 9 months ago (2017-03-24 22:56:28 UTC) #5
dyaroshev
On 2017/03/24 22:56:28, brettw (plz ping after 24h) wrote: > Comment update 1. Please link ...
3 years, 9 months ago (2017-03-25 12:26:19 UTC) #10
dyaroshev
Underlying type can be exposed in the interface. Smth like: base::flat_set<int, std::vector<int>>. Than if you ...
3 years, 9 months ago (2017-03-25 12:36:30 UTC) #11
dyaroshev
On 2017/03/25 12:36:30, dyaroshev wrote: > explicit operator underlying_type() & { > return impl_.body_; > ...
3 years, 9 months ago (2017-03-25 12:39:09 UTC) #12
dyaroshev
On 2017/03/25 12:39:09, dyaroshev wrote: > On 2017/03/25 12:36:30, dyaroshev wrote: > > explicit operator ...
3 years, 9 months ago (2017-03-25 12:42:15 UTC) #13
brettw
I used to think that keeping it unordered was fine and the obvious answer for ...
3 years, 9 months ago (2017-03-27 17:36:31 UTC) #14
dyaroshev
On 2017/03/27 17:36:31, brettw (plz ping after 24h) wrote: > I used to think that ...
3 years, 9 months ago (2017-03-27 19:24:21 UTC) #15
brettw
I think it will be helpful for Dana to weigh in as a base owner. ...
3 years, 9 months ago (2017-03-27 19:58:58 UTC) #16
dyaroshev
On 2017/03/27 19:58:58, brettw (plz ping after 24h) wrote: > I think it will be ...
3 years, 9 months ago (2017-03-27 20:11:27 UTC) #17
danakj
On 2017/03/27 19:58:58, brettw (plz ping after 24h) wrote: > I think it will be ...
3 years, 8 months ago (2017-03-28 21:16:12 UTC) #18
danakj
On 2017/03/28 21:16:12, danakj wrote: > On 2017/03/27 19:58:58, brettw (plz ping after 24h) wrote: ...
3 years, 8 months ago (2017-03-28 21:17:09 UTC) #19
dyaroshev
On 2017/03/28 21:16:12, danakj wrote: > On 2017/03/27 19:58:58, brettw (plz ping after 24h) wrote: ...
3 years, 8 months ago (2017-03-28 21:25:06 UTC) #20
danakj
On Tue, Mar 28, 2017 at 5:25 PM, <dyaroshev@yandex-team.ru> wrote: > On 2017/03/28 21:16:12, danakj ...
3 years, 8 months ago (2017-03-28 21:29:07 UTC) #21
dyaroshev
On 2017/03/28 21:29:07, danakj wrote: > Can you explain what would be bad about insert(vector)? ...
3 years, 8 months ago (2017-03-28 21:31:35 UTC) #22
danakj
On Tue, Mar 28, 2017 at 5:25 PM, <dyaroshev@yandex-team.ru> wrote: > On 2017/03/28 21:16:12, danakj ...
3 years, 8 months ago (2017-03-28 21:32:05 UTC) #23
danakj
On Tue, Mar 28, 2017 at 5:31 PM, <dyaroshev@yandex-team.ru> wrote: > On 2017/03/28 21:29:07, danakj ...
3 years, 8 months ago (2017-03-28 21:42:57 UTC) #24
dyaroshev
On 2017/03/28 21:32:05, danakj wrote: > On Tue, Mar 28, 2017 at 5:25 PM, <mailto:dyaroshev@yandex-team.ru> ...
3 years, 8 months ago (2017-03-28 21:47:46 UTC) #25
dyaroshev
On 2017/03/28 21:42:57, danakj wrote: > I see, this is a good point, there's no ...
3 years, 8 months ago (2017-03-28 21:58:33 UTC) #26
danakj
On Tue, Mar 28, 2017 at 5:47 PM, <dyaroshev@yandex-team.ru> wrote: > On 2017/03/28 21:32:05, danakj ...
3 years, 8 months ago (2017-03-28 22:07:19 UTC) #27
danakj
On Tue, Mar 28, 2017 at 5:58 PM, <dyaroshev@yandex-team.ru> wrote: > On 2017/03/28 21:42:57, danakj ...
3 years, 8 months ago (2017-03-28 22:09:29 UTC) #28
dyaroshev
On 2017/03/28 22:09:29, danakj wrote: > On Tue, Mar 28, 2017 at 5:58 PM, <mailto:dyaroshev@yandex-team.ru> ...
3 years, 8 months ago (2017-03-28 23:48:12 UTC) #29
brettw
I did some research. In MS's implementation, both std::sort and std::stable_sort both resolve to insertion ...
3 years, 8 months ago (2017-03-29 00:18:57 UTC) #30
dyaroshev
On 2017/03/29 00:18:57, brettw (plz ping after 24h) wrote: > I did some research. In ...
3 years, 8 months ago (2017-03-29 10:22:30 UTC) #31
danakj
Thanks Brett, your approach sounds good to me. Thanks for looking into sort implementations. On ...
3 years, 8 months ago (2017-03-29 18:50:03 UTC) #32
dyaroshev
On 2017/03/29 18:50:03, danakj wrote: > I'd like to see what kind of performance time/power ...
3 years, 8 months ago (2017-03-29 19:02:42 UTC) #33
danakj
On Wed, Mar 29, 2017 at 3:02 PM, <dyaroshev@yandex-team.ru> wrote: > On 2017/03/29 18:50:03, danakj ...
3 years, 8 months ago (2017-03-29 19:15:10 UTC) #34
dyaroshev
On 2017/03/29 19:15:10, danakj wrote: > On Wed, Mar 29, 2017 at 3:02 PM, <mailto:dyaroshev@yandex-team.ru> ...
3 years, 8 months ago (2017-03-29 19:32:05 UTC) #35
danakj
On Wed, Mar 29, 2017 at 3:32 PM, <dyaroshev@yandex-team.ru> wrote: > On 2017/03/29 19:15:10, danakj ...
3 years, 8 months ago (2017-03-29 19:42:56 UTC) #36
dyaroshev
On 2017/03/29 19:42:56, danakj wrote: > On Wed, Mar 29, 2017 at 3:32 PM, <mailto:dyaroshev@yandex-team.ru> ...
3 years, 8 months ago (2017-03-29 19:48:19 UTC) #37
brettw
Dana and I are optimizing for developer surprise and predictability. Being on a ~1000 person ...
3 years, 8 months ago (2017-03-29 21:27:23 UTC) #38
danakj
On Wed, Mar 29, 2017 at 5:27 PM, <brettw@chromium.org> wrote: > Dana and I are ...
3 years, 8 months ago (2017-03-29 21:33:02 UTC) #39
dyaroshev
On 2017/03/29 21:33:02, danakj wrote: > On Wed, Mar 29, 2017 at 5:27 PM, <mailto:brettw@chromium.org> ...
3 years, 8 months ago (2017-03-29 21:50:39 UTC) #40
danakj
On Wed, Mar 29, 2017 at 5:50 PM, <dyaroshev@yandex-team.ru> wrote: > On 2017/03/29 21:33:02, danakj ...
3 years, 8 months ago (2017-03-29 22:05:49 UTC) #41
dyaroshev
Ok, so I did the measurements. On mac std::stable_sort makes HQP about 0-7% slower. On ...
3 years, 8 months ago (2017-03-30 16:45:29 UTC) #42
brettw
Checkpoint
3 years, 8 months ago (2017-03-31 05:14:36 UTC) #43
dyaroshev
https://codereview.chromium.org/2776793002/diff/40001/base/containers/flat_map.h File base/containers/flat_map.h (right): https://codereview.chromium.org/2776793002/diff/40001/base/containers/flat_map.h#newcode162 base/containers/flat_map.h:162: flat_map(std::vector<value_type>&& items, Accept by value and mke it explicit ...
3 years, 8 months ago (2017-03-31 07:46:52 UTC) #44
dyaroshev
https://codereview.chromium.org/2776793002/diff/40001/base/containers/flat_tree.h File base/containers/flat_tree.h (right): https://codereview.chromium.org/2776793002/diff/40001/base/containers/flat_tree.h#newcode16 base/containers/flat_tree.h:16: }; On 2017/03/31 07:46:52, dyaroshev wrote: > I would ...
3 years, 8 months ago (2017-03-31 13:58:46 UTC) #45
dyaroshev
On 2017/03/31 13:58:46, dyaroshev wrote: > https://codereview.chromium.org/2776793002/diff/40001/base/containers/flat_tree.h > File base/containers/flat_tree.h (right): > > https://codereview.chromium.org/2776793002/diff/40001/base/containers/flat_tree.h#newcode16 > ...
3 years, 8 months ago (2017-03-31 14:28:14 UTC) #46
brettw
Update
3 years, 8 months ago (2017-03-31 22:02:36 UTC) #47
brettw
Sorry, you weren't supposed to review the "Checkpoint" one, that was just me uploading some ...
3 years, 8 months ago (2017-03-31 22:31:56 UTC) #48
dyaroshev
On 2017/03/31 22:31:56, brettw (plz ping after 24h) wrote: > Sorry, you weren't supposed to ...
3 years, 8 months ago (2017-04-01 00:52:49 UTC) #53
brettw
I uploaded a new snapshot. I made the duplicate handling explicit which will have the ...
3 years, 8 months ago (2017-04-03 23:00:09 UTC) #54
brettw
A few more fixes
3 years, 8 months ago (2017-04-04 00:11:15 UTC) #59
dyaroshev
On 2017/04/03 23:00:09, brettw (plz ping after 24h) wrote: > I uploaded a new snapshot. ...
3 years, 8 months ago (2017-04-04 09:55:56 UTC) #64
brettw
More
3 years, 8 months ago (2017-04-04 18:16:38 UTC) #65
brettw
I initially didn't add the dupe handling to the initializer list constructors because I thought ...
3 years, 8 months ago (2017-04-04 18:17:49 UTC) #66
brettw
GCC fixes
3 years, 8 months ago (2017-04-04 20:00:57 UTC) #71
brettw
Merge
3 years, 8 months ago (2017-04-04 20:49:08 UTC) #76
danakj
I'm cool with the API, mostly questions about comments, and about LastUnique https://codereview.chromium.org/2776793002/diff/180001/base/containers/flat_map.h File base/containers/flat_map.h ...
3 years, 8 months ago (2017-04-05 21:33:43 UTC) #81
dyaroshev
https://codereview.chromium.org/2776793002/diff/180001/base/containers/flat_tree.h File base/containers/flat_tree.h (right): https://codereview.chromium.org/2776793002/diff/180001/base/containers/flat_tree.h#newcode22 base/containers/flat_tree.h:22: if (first == last) On 2017/04/05 21:33:43, danakj wrote: ...
3 years, 8 months ago (2017-04-06 09:45:19 UTC) #82
brettw
Review comments
3 years, 8 months ago (2017-04-07 21:56:25 UTC) #83
brettw
Review comments addressed. dyaroshev: I honestly couldn't follow the example you posted. It seems the ...
3 years, 8 months ago (2017-04-07 21:59:04 UTC) #84
danakj
LGTM but: https://codereview.chromium.org/2776793002/diff/180001/base/containers/flat_tree.h File base/containers/flat_tree.h (right): https://codereview.chromium.org/2776793002/diff/180001/base/containers/flat_tree.h#newcode21 base/containers/flat_tree.h:21: Iterator LastUnique(Iterator first, Iterator last, BinaryPredicate compare) ...
3 years, 8 months ago (2017-04-07 22:02:53 UTC) #87
brettw
Move to internal
3 years, 8 months ago (2017-04-07 22:10:20 UTC) #88
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/2776793002/220001
3 years, 8 months ago (2017-04-07 22:11:00 UTC) #91
brettw
https://codereview.chromium.org/2776793002/diff/180001/base/containers/flat_tree.h File base/containers/flat_tree.h (right): https://codereview.chromium.org/2776793002/diff/180001/base/containers/flat_tree.h#newcode21 base/containers/flat_tree.h:21: Iterator LastUnique(Iterator first, Iterator last, BinaryPredicate compare) { On ...
3 years, 8 months ago (2017-04-07 22:13:37 UTC) #92
commit-bot: I haz the power
Try jobs failed on following builders: cast_shell_linux on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/cast_shell_linux/builds/343136) mac_chromium_rel_ng on master.tryserver.chromium.mac (JOB_FAILED, ...
3 years, 8 months ago (2017-04-07 22:22:55 UTC) #94
brettw
Put back media log change lost in merge
3 years, 8 months ago (2017-04-07 22:32:11 UTC) #95
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/2776793002/240001
3 years, 8 months ago (2017-04-07 22:33:27 UTC) #98
commit-bot: I haz the power
3 years, 8 months ago (2017-04-08 01:13:38 UTC) #101
Message was sent while issue was closed.
Committed patchset #13 (id:240001) as
https://chromium.googlesource.com/chromium/src/+/5c72fdadcbe0e5914a2a1c935992...

Powered by Google App Engine
This is Rietveld 408576698