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)};
51 [](size_t) ->
size_t {
return 0; },
59 std::vector<void*> inputs;
64 void* header = malloc(
stack.size());
65 void* payload = malloc(
sizeof(
int));
67 memcpy(payload, &
value,
sizeof(
int));
68 inputs.emplace_back(header);
69 inputs.emplace_back(payload);
72 auto createEmpty = [&inputs]() {
73 inputs.emplace_back(
nullptr);
74 inputs.emplace_back(
nullptr);
87 createMessage(dh1, 1);
88 createMessage(dh2, 2);
91 [](size_t) ->
size_t {
return 1; },
93 [&inputs](
size_t i,
DataRefIndices idx) {
return DataRef{
nullptr,
static_cast<char const*
>(inputs[2 *
i + idx.headerIdx]),
static_cast<char const*
>(inputs[2 *
i + idx.payloadIdx])}; },
98 for (
auto _ :
state) {
100 [[maybe_unused]]
auto ref00 = record.
get(
"x");
101 [[maybe_unused]]
auto ref10 = record.get(
"y");
102 [[maybe_unused]]
auto ref20 = record.get(
"z");
105 [[maybe_unused]]
auto ref01 = record.getByPos(0);
106 [[maybe_unused]]
auto ref11 = record.getByPos(1);
std::shared_ptr< arrow::Schema > schema
o2::monitoring::Monitoring Monitoring
GLsizei GLsizei GLchar * source
GLsizei const GLfloat * value
Defining ITS Vertex explicitly as messageable.
void * get(ServiceTypeHash typeHash, Salt salt, ServiceKind kind, char const *name=nullptr) const