----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/71579/#review218061 -----------------------------------------------------------
Ship it! Can you briefly describe the fix in the description? e.g. ``` This patch replaces `multimap<k, v>` with `hasmap<k, vector<v>>`. ``` A quick search of multimap shows more instances. After a few spot checks, I don't see multimap.keys(). Maybe we should consider getting rid of `Multimap<K, V>::keys`. Also, it is not clear to me why we used multimap in a few places (other than a little bit less code), they could be replaced with `hasmap<k, vector<v>>` for better performance. e.g. a common used method, `multihashmap.contains(k, v)` copies the value of the given key: https://github.com/apache/mesos/blob/master/3rdparty/stout/include/stout/multimap.hpp#L126 - Meng Zhu On Oct. 3, 2019, 1:59 p.m., Benjamin Mahler wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/71579/ > ----------------------------------------------------------- > > (Updated Oct. 3, 2019, 1:59 p.m.) > > > Review request for mesos, haosdent huang and Meng Zhu. > > > Bugs: MESOS-9889 > https://issues.apache.org/jira/browse/MESOS-9889 > > > Repository: mesos > > > Description > ------- > > Per MESOS-9889, the foreachkey operator on a multimap will actually > loop over each <key,value> entry, thus looping over the same key > multiple times. The code in the master is written such that > excessive looping occurs. > > For example: <F1,T1> <F1,T2> <F1,T3> > This will consider T1,T2,T3 3 times each rather than once each! > > > Diffs > ----- > > src/master/master.hpp 23eb2a6854b1b53f80167cc8425339530de78e81 > src/master/master.cpp 65994aa72ec4bfefdb09b88a62db910727bb0897 > > > Diff: https://reviews.apache.org/r/71579/diff/1/ > > > Testing > ------- > > make check > > > Thanks, > > Benjamin Mahler > >
