----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/69068/#review209724 -----------------------------------------------------------
Ship it! "Flag" may mislead the reader to think this is a command line flag, how about the following commit summary: ``` Cached whether agents have gpus to improve allocator performance. ``` src/master/allocator/mesos/hierarchical.hpp Lines 257-262 (patched) <https://reviews.apache.org/r/69068/#comment294268> Maybe we can make this a little more succinct? ``` // We cache whether the agent has gpus as an optimization. ``` - Benjamin Mahler On Oct. 17, 2018, 11:41 p.m., Meng Zhu wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/69068/ > ----------------------------------------------------------- > > (Updated Oct. 17, 2018, 11:41 p.m.) > > > Review request for mesos, Benjamin Mahler and Gastón Kleiman. > > > Repository: mesos > > > Description > ------- > > Due to the `filterGpuResources` mechanism, before making any > allocations, the allocator needs to check if an agent has > any GPU resources. This is currently done by calling the > `Resources::gpus()` function which traverse the resource > vector and copy the scalar. Since this is frequently called > and agent total resources rarely change, caching this boolean > will yield quite some performance improvement. > > > Diffs > ----- > > src/master/allocator/mesos/hierarchical.hpp > e09a615979014909e7b88d44e6617fd1476415c5 > src/master/allocator/mesos/hierarchical.cpp > 6f389ed46683f7c642e87b673dc15307cc2b5cd6 > > > Diff: https://reviews.apache.org/r/69068/diff/1/ > > > Testing > ------- > > make check > > > Thanks, > > Meng Zhu > >
