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 69032: Optimized resources filter operation.
Date Wed, 17 Oct 2018 00:24:05 GMT

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


Ship it!




Can you also post the filter benchmark results?

https://github.com/apache/mesos/blob/1.7.0/src/tests/resources_tests.cpp#L3865-L3920


src/common/resources.cpp
Line 1550 (original), 1550 (patched)
<https://reviews.apache.org/r/69032/#comment294222>

    Consider reserving the result vector?



src/common/resources.cpp
Line 1555 (original), 1555 (patched)
<https://reviews.apache.org/r/69032/#comment294221>

    Probably warrants a comment about why we just add it to the vector instead of adding?


- Benjamin Mahler


On Oct. 16, 2018, 11:16 p.m., Meng Zhu wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/69032/
> -----------------------------------------------------------
> 
> (Updated Oct. 16, 2018, 11:16 p.m.)
> 
> 
> Review request for mesos, Benjamin Mahler and Gastón Kleiman.
> 
> 
> Bugs: MESOS-9325
>     https://issues.apache.org/jira/browse/MESOS-9325
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> Currently, `Resources::filter()` operation uses `add()` which
> scans the resources vector, a O(n) operation. This is not
> necessary. `filter()` operation should only remove `Resource`
> entires. This patch optimizes the performance by directly
> `push_back` the resource to the vector without scanning.
> 
> 
> Diffs
> -----
> 
>   src/common/resources.cpp f0f3df579550d874e477e2d6e7d0e87df079358a 
>   src/v1/resources.cpp 4d2b64f6e30ef96b47fc0b72b00158864e245650 
> 
> 
> Diff: https://reviews.apache.org/r/69032/diff/1/
> 
> 
> Testing
> -------
> 
> make check
> 
> 
> Thanks,
> 
> Meng Zhu
> 
>


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