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

Issue 2859593002: base: Add bulk insert to flat_tree. (Closed)

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

Description

base: Add bulk insert to flat_tree. This patch adds a bulk insert into flat tree, which does the following: - Appends new elements to the end of the existing vector - Sorts the newly added elements - Does an inplace merge of the two sublists - Does a unique pass. Starting with a vector of size N, inserting a range of M elements should be roughly O(M log M) + O(N + M) + O(N + M) R=brettw@chromium.org, danakj@chromium.org

Patch Set 1 #

Patch Set 2 : update #

Unified diffs Side-by-side diffs Delta from patch set Stats (+71 lines, -2 lines) Patch
M base/containers/flat_tree.h View 1 3 chunks +28 lines, -2 lines 0 comments Download
M base/containers/flat_tree_unittest.cc View 1 chunk +43 lines, -0 lines 0 comments Download

Messages

Total messages: 15 (3 generated)
vmpstr
Please take a look. It's not really a blocker for me, but I found that ...
3 years, 7 months ago (2017-05-02 18:59:37 UTC) #3
vmpstr
(or whether there are still concerns about performance that prevent this type of patch from ...
3 years, 7 months ago (2017-05-02 19:00:18 UTC) #4
vmpstr
ping, danakj do you think this is worth doing?
3 years, 7 months ago (2017-05-04 15:45:21 UTC) #6
danakj
On 2017/05/04 15:45:21, vmpstr wrote: > ping, danakj do you think this is worth doing? ...
3 years, 7 months ago (2017-05-04 17:59:16 UTC) #7
vmpstr
On 2017/05/04 17:59:16, danakj wrote: > On 2017/05/04 15:45:21, vmpstr wrote: > > ping, danakj ...
3 years, 7 months ago (2017-05-04 21:24:35 UTC) #8
danakj
On Thu, May 4, 2017 at 5:24 PM, <vmpstr@chromium.org> wrote: > On 2017/05/04 17:59:16, danakj ...
3 years, 7 months ago (2017-05-04 21:41:56 UTC) #9
vmpstr
On 2017/05/04 21:41:56, danakj wrote: > On Thu, May 4, 2017 at 5:24 PM, <mailto:vmpstr@chromium.org> ...
3 years, 7 months ago (2017-05-04 21:57:39 UTC) #10
danakj
On Thu, May 4, 2017 at 5:57 PM, <vmpstr@chromium.org> wrote: > On 2017/05/04 21:41:56, danakj ...
3 years, 7 months ago (2017-05-05 14:59:24 UTC) #11
brettw
On 2017/05/05 14:59:24, danakj wrote: > I suppose it diverges from map, but as a ...
3 years, 7 months ago (2017-05-05 21:42:47 UTC) #12
danakj
On Fri, May 5, 2017 at 5:42 PM, <brettw@chromium.org> wrote: > On 2017/05/05 14:59:24, danakj ...
3 years, 7 months ago (2017-05-05 22:10:27 UTC) #13
vmpstr
On 2017/05/05 22:10:27, danakj wrote: > On Fri, May 5, 2017 at 5:42 PM, <mailto:brettw@chromium.org> ...
3 years, 7 months ago (2017-05-05 22:30:08 UTC) #14
danakj
3 years, 7 months ago (2017-05-09 23:07:52 UTC) #15
Message was sent while issue was closed.
On Fri, May 5, 2017 at 6:30 PM, <vmpstr@chromium.org> wrote:

> On 2017/05/05 22:10:27, danakj wrote:
> > On Fri, May 5, 2017 at 5:42 PM, <mailto:brettw@chromium.org> wrote:
> >
> > > On 2017/05/05 14:59:24, danakj wrote:
> > > > I suppose it diverges from map, but as a counterpoint, vector has an
> > > insert
> > > > of another vector for instance.
> > >
> > > I wasn't aware of this and I couldn't find it in the docs. Are you
> sure?
> > >
> >
> > Nope, I made it up. I was thinking of insert from iterators and insert
> from
> > initializer list. These are algorithmically same as inserting from a
> vector
> > though, for that structure. But for flat_set it's not sufficient. It's at
> > those junctions where I think we should diverge the API when it's useful.
> > So all that's to say I think inserting another flat_set into a flat_set
> > seems like it's a good thing to add if you have a use case for it.
> >
>
> The case I was looking at was switching these sets
> https://cs.chromium.org/chromium/src/chrome/browser/
> ui/unload_controller.h?l=148
>
> to flat set (same for fast_unload_controller). The problem case I ran into
> is
> here:
> https://cs.chromium.org/chromium/src/chrome/browser/
> ui/unload_controller.cc?l=313
>
> which inserts one of these sets into another one of the same type. Maybe
> this
> could also be altogether changed, since I'm not sure if the set properties
> here
> are important or whether a vector would do.
>

Cool, thanks, that does seem like a pretty exemplary use case :)


>
>
> >
> > >
> > > https://codereview.chromium.org/2859593002/
> > >
> >
> > --
> > You received this message because you are subscribed to the Google Groups
> > "Chromium-reviews" group.
> > To unsubscribe from this group and stop receiving emails from it, send an
> email
> > to mailto:chromium-reviews+unsubscribe@chromium.org.
>
>
>
> https://codereview.chromium.org/2859593002/
>

-- 
You received this message because you are subscribed to the Google Groups
"Chromium-reviews" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to chromium-reviews+unsubscribe@chromium.org.

Powered by Google App Engine
This is Rietveld 408576698