mesos-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Benjamin Bannier <benjamin.bann...@mesosphere.io>
Subject Re: Review Request 58040: Avoid various redundant copies.
Date Mon, 03 Apr 2017 09:06:22 GMT


> 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
> 
>


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