mesos-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andrei Budnik <abud...@mesosphere.com>
Subject Review Request 60545: Optimized use of DispatchEvent by lazy evaluation of method value.
Date Thu, 29 Jun 2017 17:08:55 GMT

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

Review request for mesos, Alexander Rukletsov and Michael Park.


Repository: mesos


Description
-------

DispatchEvent contains value of pointer-to-member function stored in
std::string, which is calculated each time DispatchEvent object is
constructed. However, this value is used only in tests (see
FUTURE_DISPATCH), imposing unnecessary overhead in production.
This patch introduces lazy evolution of pointer-to-member by storing
std::function object instead of std::string. Wrapper function captures
value of pointer-to-member function and returns its stringified version
on invocation. This function invoked by demand in test code, hence
mitigating overhead of evaluation and storing value of pointer to
member function.


Diffs
-----

  3rdparty/libprocess/include/process/dispatch.hpp 3a0793888dc0df5e3ec31b06f47cd920c71e0db9

  3rdparty/libprocess/include/process/event.hpp 8afe6266eb0dc5a17af35d79efb6bfdf9e6a0ee9 
  3rdparty/libprocess/include/process/gmock.hpp e9af943b39436f365fe687301febb5c7fbefffc4 
  3rdparty/libprocess/src/process.cpp 8ff37d1b5781c42f96be2da391ed000158eea7b8 


Diff: https://reviews.apache.org/r/60545/diff/1/


Testing
-------

1. make check (mac os x 10.12, fedora 25)
2. internal CI


Thanks,

Andrei Budnik


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