|
| 1 | +// Copyright 2019-2020 CERN and copyright holders of ALICE O2. |
| 2 | +// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. |
| 3 | +// All rights not expressly granted are reserved. |
| 4 | +// |
| 5 | +// This software is distributed under the terms of the GNU General Public |
| 6 | +// License v3 (GPL Version 3), copied verbatim in the file "COPYING". |
| 7 | +// |
| 8 | +// In applying this license CERN does not waive the privileges and immunities |
| 9 | +// granted to it by virtue of its status as an Intergovernmental Organization |
| 10 | +// or submit itself to any jurisdiction. |
| 11 | +#include <benchmark/benchmark.h> |
| 12 | + |
| 13 | +#include "Framework/DataProcessingHeader.h" |
| 14 | +#include "Headers/DataHeader.h" |
| 15 | +#include "Headers/Stack.h" |
| 16 | +#include <iostream> |
| 17 | + |
| 18 | +// a simple benchmark of the contribution of the pure message creation |
| 19 | +// this was important when the benchmarks below included the message |
| 20 | +// creation inside the benchmark loop, its somewhat obsolete now but |
| 21 | +// we keep it for reference |
| 22 | +static void BM_RelayStackLifecycle(benchmark::State& state) |
| 23 | +{ |
| 24 | + using namespace o2::framework; |
| 25 | + using namespace o2::header; |
| 26 | + DataProcessingHeader dph{0, 1}; |
| 27 | + |
| 28 | + for (auto _ : state) { |
| 29 | + DataHeader dh; |
| 30 | + dh.dataDescription = "CLUSTERS"; |
| 31 | + dh.dataOrigin = "TPC"; |
| 32 | + dh.subSpecification = 0; |
| 33 | + |
| 34 | + DataProcessingHeader dph{0, 1}; |
| 35 | + Stack stack{dh, dph}; |
| 36 | + } |
| 37 | +} |
| 38 | + |
| 39 | +BENCHMARK(BM_RelayStackLifecycle); |
| 40 | + |
| 41 | +BENCHMARK_MAIN(); |
0 commit comments