|
25 | 25 | #include <Monitoring/Monitoring.h> |
26 | 26 | #include <fairmq/TransportFactory.h> |
27 | 27 | #include <cstring> |
| 28 | +#include <iterator> |
28 | 29 | #include <vector> |
29 | 30 | #include <uv.h> |
30 | 31 |
|
@@ -140,7 +141,8 @@ static void BM_RelaySingleSlot(benchmark::State& state) |
140 | 141 | auto result = relayer.consumeAllInputsForTimeslice(ready[0].slot); |
141 | 142 | assert(result.size() == 1); |
142 | 143 | assert((result.at(0) | count_parts{}) == 1); |
143 | | - inflightMessages = std::move(result[0]); |
| 144 | + inflightMessages.assign(std::make_move_iterator(result[0].begin()), |
| 145 | + std::make_move_iterator(result[0].end())); |
144 | 146 | } |
145 | 147 | } |
146 | 148 |
|
@@ -196,7 +198,8 @@ static void BM_RelayMultipleSlots(benchmark::State& state) |
196 | 198 | auto result = relayer.consumeAllInputsForTimeslice(ready[0].slot); |
197 | 199 | assert(result.size() == 1); |
198 | 200 | assert((result.at(0) | count_parts{}) == 1); |
199 | | - inflightMessages = std::move(result[0]); |
| 201 | + inflightMessages.assign(std::make_move_iterator(result[0].begin()), |
| 202 | + std::make_move_iterator(result[0].end())); |
200 | 203 | } |
201 | 204 | } |
202 | 205 |
|
@@ -271,9 +274,11 @@ static void BM_RelayMultipleRoutes(benchmark::State& state) |
271 | 274 | assert(result.size() == 2); |
272 | 275 | assert((result.at(0) | count_parts{}) == 1); |
273 | 276 | assert((result.at(1) | count_parts{}) == 1); |
274 | | - inflightMessages = std::move(result[0]); |
275 | | - inflightMessages.emplace_back(std::move(result[1][0])); |
276 | | - inflightMessages.emplace_back(std::move(result[1][1])); |
| 277 | + inflightMessages.assign(std::make_move_iterator(result[0].begin()), |
| 278 | + std::make_move_iterator(result[0].end())); |
| 279 | + inflightMessages.insert(inflightMessages.end(), |
| 280 | + std::make_move_iterator(result[1].begin()), |
| 281 | + std::make_move_iterator(result[1].end())); |
277 | 282 | } |
278 | 283 | } |
279 | 284 |
|
@@ -333,7 +338,9 @@ static void BM_RelaySplitParts(benchmark::State& state) |
333 | 338 | relayer.getReadyToProcess(ready); |
334 | 339 | assert(ready.size() == 1); |
335 | 340 | assert(ready[0].op == CompletionPolicy::CompletionOp::Consume); |
336 | | - inflightMessages = std::move(relayer.consumeAllInputsForTimeslice(ready[0].slot)[0]); |
| 341 | + auto result = relayer.consumeAllInputsForTimeslice(ready[0].slot); |
| 342 | + inflightMessages.assign(std::make_move_iterator(result[0].begin()), |
| 343 | + std::make_move_iterator(result[0].end())); |
337 | 344 | } |
338 | 345 | } |
339 | 346 |
|
@@ -387,7 +394,9 @@ static void BM_RelayMultiplePayloads(benchmark::State& state) |
387 | 394 | relayer.getReadyToProcess(ready); |
388 | 395 | assert(ready.size() == 1); |
389 | 396 | assert(ready[0].op == CompletionPolicy::CompletionOp::Consume); |
390 | | - inflightMessages = std::move(relayer.consumeAllInputsForTimeslice(ready[0].slot)[0]); |
| 397 | + auto result = relayer.consumeAllInputsForTimeslice(ready[0].slot); |
| 398 | + inflightMessages.assign(std::make_move_iterator(result[0].begin()), |
| 399 | + std::make_move_iterator(result[0].end())); |
391 | 400 | } |
392 | 401 | } |
393 | 402 |
|
|
0 commit comments