mesos-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Benjamin Mahler <bmah...@apache.org>
Subject Re: Review Request 67369: Introduced a weighted shuffle algorithm implementation.
Date Sun, 03 Jun 2018 01:25:34 GMT


> On May 31, 2018, 7:47 p.m., Meng Zhu wrote:
> > src/master/allocator/sorter/random/utils.hpp
> > Lines 53-59 (patched)
> > <https://reviews.apache.org/r/67369/diff/1/?file=2031732#file2031732line53>
> >
> >     Why do we need to construct the random distribution every time? How about:
> >     
> >     ```
> >     std::uniform_real_distribution<> dis(0.0, 1.0);
> >     for (...) {
> >       ...
> >       keys[i] = 0.0 - std::pow(dis(urbg), (1.0 / weights[i]));
> >     }
> >     ```

It seemed a little more readable to me, and I assumed the cost was very low (e.g. no memory
allocation). Would be good to pull it out if that's not the case!


- Benjamin


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


On May 30, 2018, 12:55 a.m., Benjamin Mahler wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/67369/
> -----------------------------------------------------------
> 
> (Updated May 30, 2018, 12:55 a.m.)
> 
> 
> Review request for mesos, Gaston Kleiman, Greg Mann, and Meng Zhu.
> 
> 
> Bugs: MESOS-8936
>     https://issues.apache.org/jira/browse/MESOS-8936
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> This will be used by the random sorter in order to support weights.
> 
> 
> Diffs
> -----
> 
>   src/Makefile.am b7184ceccef5f2e985d905c155156f95c7a7c7b4 
>   src/master/allocator/sorter/random/utils.hpp PRE-CREATION 
> 
> 
> Diff: https://reviews.apache.org/r/67369/diff/1/
> 
> 
> Testing
> -------
> 
> Test added in subsequent patch.
> 
> 
> Thanks,
> 
> Benjamin Mahler
> 
>


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