mesos-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ben Mahler" <benjamin.mah...@gmail.com>
Subject Re: Review Request 31700: Reserved memory for JSON arrays where appropriate.
Date Wed, 11 Mar 2015 21:38:11 GMT

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

Ship it!


Thanks alex, just one minor item and we can get this committed!


src/common/http.cpp
<https://reviews.apache.org/r/31700/#comment123581>

    Can you make these consistent with the ones below?
    
    E.g.
    
    ```
    {
      JSON::Array array;
      array.reserve(task.statuses().size()); // MESOS-2353.
      
      foreach (const TaskStatus& status, task.statuses()) {
        statuses.values.push_back(model(status));
      }
      
      object.values["statuses"] = array;
    }
    
    {
      JSON::Array array;
      array.reserve(task.labels().labels().size()); // MESOS-2353.
      
      foreach (const Label& label, task.labels().labels()) {
        labels.values.push_back(JSON::Protobuf(label));
      }
      
      object.values["labels"] = array;
    }
    ```



src/master/http.cpp
<https://reviews.apache.org/r/31700/#comment123582>

    Do you know if a move is helpful here or if the compiler is already optimizing this?
    
    ```
    object.values["slaves"] = std::move(array);
    ```
    
    Don't do it in this change, we need to measure and I'm just curious :)


- Ben Mahler


On March 7, 2015, 1:43 a.m., Alexander Rukletsov wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/31700/
> -----------------------------------------------------------
> 
> (Updated March 7, 2015, 1:43 a.m.)
> 
> 
> Review request for mesos and Ben Mahler.
> 
> 
> Bugs: MESOS-2353
>     https://issues.apache.org/jira/browse/MESOS-2353
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> See summary.
> 
> 
> Diffs
> -----
> 
>   src/common/http.cpp 0b57fb01f7769031704e5341849bf95a0197ffd9 
>   src/master/http.cpp b8eef69505b147d4c8a0e005dff545b9fc12a220 
> 
> Diff: https://reviews.apache.org/r/31700/diff/
> 
> 
> Testing
> -------
> 
> make check (OS X 10.9.5, Ubuntu 14.04)
> 
> 
> Thanks,
> 
> Alexander Rukletsov
> 
>


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