11#include <benchmark/benchmark.h>
20#include <Monitoring/Monitoring.h>
21#include <fairmq/TransportFactory.h>
29static void BM_InputRecordGenericGetters(benchmark::State& state)
32 InputSpec spec1{
"x",
"TPC",
"CLUSTERS", 0, Lifetime::Timeframe};
33 InputSpec spec2{
"y",
"ITS",
"CLUSTERS", 0, Lifetime::Timeframe};
34 InputSpec spec3{
"z",
"TST",
"EMPTY", 0, Lifetime::Timeframe};
44 std::vector<InputRoute> schema = {
45 createRoute(
"x_source", spec1),
46 createRoute(
"y_source", spec2),
47 createRoute(
"z_source", spec3)};
50 InputSpan span{[](size_t) {
return DataRef{
nullptr,
nullptr,
nullptr}; }, 0};
54 std::vector<void*> inputs;
59 void* header = malloc(
stack.size());
60 void* payload = malloc(
sizeof(
int));
62 memcpy(payload, &
value,
sizeof(
int));
63 inputs.emplace_back(header);
64 inputs.emplace_back(payload);
67 auto createEmpty = [&inputs]() {
68 inputs.emplace_back(
nullptr);
69 inputs.emplace_back(
nullptr);
82 createMessage(dh1, 1);
83 createMessage(dh2, 2);
85 InputSpan span2{[&inputs](
size_t i) {
return DataRef{
nullptr,
static_cast<char const*
>(inputs[2 *
i]),
static_cast<char const*
>(inputs[2 *
i + 1])}; }, inputs.size() / 2};
88 for (
auto _ :
state) {
90 [[maybe_unused]]
auto ref00 = record.
get(
"x");
91 [[maybe_unused]]
auto ref10 = record.get(
"y");
92 [[maybe_unused]]
auto ref20 = record.get(
"z");
95 [[maybe_unused]]
auto ref01 = record.getByPos(0);
96 [[maybe_unused]]
auto ref11 = record.getByPos(1);
o2::monitoring::Monitoring Monitoring
GLsizei GLsizei GLchar * source
GLsizei const GLfloat * value
Defining PrimaryVertex explicitly as messageable.
void * get(ServiceTypeHash typeHash, Salt salt, ServiceKind kind, char const *name=nullptr) const