You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by bm...@apache.org on 2018/05/24 21:32:42 UTC
mesos git commit: Fixed a performance issue in collect/await.
Repository: mesos
Updated Branches:
refs/heads/master 32d4305b8 -> 05594d69d
Fixed a performance issue in collect/await.
It turns out that even with C++11, some `std::list::size()`
implementations are still linear in complexity.
This was found when running perf against a metrics benchmark
for the master. A follow-up to avoid std::list in the collect.hpp
interfaces entirely is needed.
Review: https://reviews.apache.org/r/67298
Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/05594d69
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/05594d69
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/05594d69
Branch: refs/heads/master
Commit: 05594d69d8903ddc406703a49b8568c579ff803d
Parents: 32d4305
Author: Benjamin Mahler <bm...@apache.org>
Authored: Thu May 24 14:06:29 2018 -0700
Committer: Benjamin Mahler <bm...@apache.org>
Committed: Thu May 24 14:32:29 2018 -0700
----------------------------------------------------------------------
3rdparty/libprocess/include/process/collect.hpp | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/mesos/blob/05594d69/3rdparty/libprocess/include/process/collect.hpp
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/include/process/collect.hpp b/3rdparty/libprocess/include/process/collect.hpp
index 7e07b1d..c122a98 100644
--- a/3rdparty/libprocess/include/process/collect.hpp
+++ b/3rdparty/libprocess/include/process/collect.hpp
@@ -123,7 +123,7 @@ public:
const std::list<Future<T>>& _futures,
Promise<std::list<T>>* _promise)
: ProcessBase(ID::generate("__collect__")),
- futures(_futures),
+ futures(_futures.begin(), _futures.end()),
promise(_promise),
ready(0) {}
@@ -189,7 +189,7 @@ private:
}
}
- const std::list<Future<T>> futures;
+ const std::vector<Future<T>> futures;
Promise<std::list<T>>* promise;
size_t ready;
};
@@ -203,7 +203,7 @@ public:
const std::list<Future<T>>& _futures,
Promise<std::list<Future<T>>>* _promise)
: ProcessBase(ID::generate("__await__")),
- futures(_futures),
+ futures(_futures.begin(), _futures.end()),
promise(_promise),
ready(0) {}
@@ -252,12 +252,13 @@ private:
ready += 1;
if (ready == futures.size()) {
- promise->set(futures);
+ promise->set(
+ std::list<Future<T>>(futures.begin(), futures.end()));
terminate(this);
}
}
- const std::list<Future<T>> futures;
+ const std::vector<Future<T>> futures;
Promise<std::list<Future<T>>>* promise;
size_t ready;
};