Project
Loading...
Searching...
No Matches
benchmark_Stack.cxx
Go to the documentation of this file.
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
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
22static 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
39BENCHMARK(BM_RelayStackLifecycle);
40
benchmark::State & state
uint32_t stack
Definition RawData.h:1
BENCHMARK_MAIN()
BENCHMARK(BM_RelayStackLifecycle)
Defining PrimaryVertex explicitly as messageable.
Definition TFIDInfo.h:20
O2 data header classes and API, v0.1.
Definition DetID.h:49
the main header struct
Definition DataHeader.h:618
DataDescription dataDescription
Definition DataHeader.h:636
SubSpecificationType subSpecification
Definition DataHeader.h:656
a move-only header stack with serialized headers This is the flat buffer where all the headers in a m...
Definition Stack.h:33