Skip to content

Commit f9fa54e

Browse files
committed
DPL: add benchmark for stack creation
1 parent a1c484d commit f9fa54e

File tree

2 files changed

+42
-0
lines changed

2 files changed

+42
-0
lines changed

Framework/Core/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -339,6 +339,7 @@ o2_add_executable(dpl-run
339339
foreach(b
340340
DataDescriptorMatcher
341341
DataRelayer
342+
Stack
342343
DeviceMetricsInfo
343344
InputRecord
344345
TableBuilder
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
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

Comments
 (0)