mesos-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Meng Zhu <m...@mesosphere.io>
Subject Re: Review Request 68808: Avoided dirtying the DRF sorter when an allocation is performed.
Date Wed, 26 Sep 2018 21:33:04 GMT


> On Sept. 26, 2018, 1:43 p.m., Meng Zhu wrote:
> > src/master/allocator/sorter/drf/sorter.cpp
> > Lines 365-369 (patched)
> > <https://reviews.apache.org/r/68808/diff/1/?file=2091850#file2091850line365>
> >
> >     I think we can just work with iterators. It will be more generic and readable.
I will leave that to you.

e.g. something like this:

```
  while (it != children.begin() &&
         DRFSorter::Node::compareDRF(current, *std::prev(it))) {
    std::swap(it, std::prev(it));
    it--;
  }

  while (std::next(it) != children.end() &&
         *std::next(it)->kind != Node::INACTIVE_LEAF &&
         DRFSorter::Node::compareDRF(*std::next(it), current)) {
    std::swap(it, std::next(it));
    it++;
  }
```

This could be more generic if we want to change the container type to say list.


- Meng


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/68808/#review209041
-----------------------------------------------------------


On Sept. 24, 2018, 7:23 p.m., Benjamin Mahler wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/68808/
> -----------------------------------------------------------
> 
> (Updated Sept. 24, 2018, 7:23 p.m.)
> 
> 
> Review request for mesos, Gastón Kleiman and Meng Zhu.
> 
> 
> Bugs: MESOS-9249
>     https://issues.apache.org/jira/browse/MESOS-9249
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> This improves performance by ensuring that the DRF sorter can remain
> sorted throughout an allocation cycle. Without this change, we spend
> the majority of time re-sorting throughout an allocation cycle, when
> there are large numbers of clients (roles / frameworks).
> 
> Before with --enable-optimize:
> 
> *HierarchicalAllocator_BENCHMARK_Test.DeclineOffers/21
> Added 1000 frameworks in 28.685387ms
> Added 10000 agents in 3.962511243secs
> round 0 allocate() took 3.183115931secs to make 10000 offers ...
> round 1 allocate() took 3.398068093secs to make 10000 offers ...
> round 2 allocate() took 3.314738469secs to make 10000 offers ...
> 
> After with --enable-optimize:
> 
> *HierarchicalAllocator_BENCHMARK_Test.DeclineOffers/21
> Added 1000 frameworks in 38.145091ms
> Added 10000 agents in 1.791872685secs
> round 0 allocate() took 1.193577545secs to make 10000 offers ...
> round 1 allocate() took 1.288540671secs to make 10000 offers ...
> round 2 allocate() took 1.169376468secs to make 10000 offers ...
> 
> 
> Diffs
> -----
> 
>   src/master/allocator/sorter/drf/sorter.cpp a45f66ff0d77becb6f96f7ff4c288e4ab218e070

> 
> 
> Diff: https://reviews.apache.org/r/68808/diff/1/
> 
> 
> Testing
> -------
> 
> make check
> 
> 
> Thanks,
> 
> Benjamin Mahler
> 
>


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message