You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@mesos.apache.org by Benjamin Bannier <be...@mesosphere.io> on 2017/04/03 09:06:22 UTC

Re: Review Request 58040: Avoid various redundant copies.


> On March 30, 2017, 10:36 a.m., Benjamin Bannier wrote:
> > The changes here look good to me, but running
> > 
> >     % CHECKS='-*,performance-unnecessary-copy-initialization' ./support/mesos-tidy.sh
> >     
> > still emits a lot of unneeded copy warnings. Could you have a look what other candidates for a fix are there? Ideally we'd either be able to fix all instances and add this to the default check list.
> 
> Neil Conway wrote:
>     Yeah, there are a lot of other places to fix -- I wanted to do them piecemeal, though (e.g., the copy semantics around `Future<T>` can be subtle). The places I fixed in this patch all seemed quite straightforward, so I'd prefer to leave the other places for a separate change.

I was more talking about e.g., the mundane instances copying e.g., `agentId`s, but agree that we'd want to be careful about copies of data structures involving shared ptrs in function arguments (I believe function-local copies of e.g., `Future<T>` are in general not needed; otherwise let's fix the interfaces).

That being said, I'd much more in favor of fixing this in general and e.g., enabling a clang-tidy check, than going piecemeal which induces a lot of churn in the code and in reviews.


- Benjamin


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


On March 30, 2017, 3:15 a.m., Neil Conway wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/58040/
> -----------------------------------------------------------
> 
> (Updated March 30, 2017, 3:15 a.m.)
> 
> 
> Review request for mesos and Benjamin Bannier.
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> Spotted using the "performance-unnecessary-copy-initialization"
> clang-tidy check.
> 
> 
> Diffs
> -----
> 
>   src/examples/dynamic_reservation_framework.cpp c1650dc978dddf14cf1e22a33752b58b06914ff4 
>   src/master/master.hpp d92c8adef79d997f255cf26ebd10ab0e87da8413 
>   src/master/master.cpp ab071f56a66ae66c97a185b2377a9cfe9a5c1ade 
>   src/oci/spec.cpp 06fceb4f0441431d756eb45c8aaf9730ef9e248a 
>   src/tests/default_executor_tests.cpp 6dadd8937eb6809bcb0aca55fab1cb7f17c3262f 
> 
> 
> Diff: https://reviews.apache.org/r/58040/diff/2/
> 
> 
> Testing
> -------
> 
> `make check`
> 
> 
> Thanks,
> 
> Neil Conway
> 
>