12#ifndef RTCTK_COMPONENTFRAMEWORK_TEST_REPOSITORYIFV2BENCH_HPP
13#define RTCTK_COMPONENTFRAMEWORK_TEST_REPOSITORYIFV2BENCH_HPP
17#include <benchmark/benchmark.h>
20static std::shared_ptr<RepositoryIf> MakeRepository();
25static void BM_WriteScalars(benchmark::State& state) {
29 auto repo = MakeRepository();
32 repo->CreateDataPoint(path, value);
34 for (
auto _ : state) {
35 repo->WriteDataPoint(path, value);
38 repo->DeleteDataPoint(path);
42static void BM_ReadScalars(benchmark::State& state) {
46 auto repo = MakeRepository();
49 repo->CreateDataPoint(path, value);
51 for (
auto _ : state) {
52 repo->ReadDataPoint(path, value);
55 repo->DeleteDataPoint(path);
59static void BM_WriteVectors(benchmark::State& state) {
63 auto repo = MakeRepository();
66 repo->CreateDataPoint(path, value);
68 for (
auto _ : state) {
69 repo->WriteDataPoint(path, value);
72 repo->DeleteDataPoint(path);
76static void BM_ReadVectors(benchmark::State& state) {
80 auto repo = MakeRepository();
83 repo->CreateDataPoint(path, value);
85 for (
auto _ : state) {
86 repo->ReadDataPoint(path, value);
89 repo->DeleteDataPoint(path);
95 ->ReportAggregatesOnly()
96 ->Unit(benchmark::kMillisecond);
101 ->ReportAggregatesOnly()
102 ->Unit(benchmark::kMillisecond);
108 ->Arg(10 * 1024 * 1024)
109 ->Arg(100 * 1024 * 1024)
110 ->Arg(400 * 1024 * 1024)
111 ->ReportAggregatesOnly()
112 ->Unit(benchmark::kMillisecond);
118 ->Arg(10 * 1024 * 1024)
119 ->Arg(100 * 1024 * 1024)
120 ->Arg(400 * 1024 * 1024)
121 ->ReportAggregatesOnly()
122 ->Unit(benchmark::kMillisecond);
This class provides a wrapper for a data point path.
Definition dataPointPath.hpp:76
Definition fakeClock.cpp:14
Definition commandReplier.cpp:21
float RtcFloat
Definition basicTypes.hpp:45
RtcVector< RtcInt8 > RtcVectorInt8
Definition basicTypes.hpp:50
Header file for RepositoryIf and related base classes.
BENCHMARK(BmCorrelator) -> Ranges({{1, 16}, {1, 128}})
Register BmCorrelator benchmark with two ranges of arguments: 0: Number of topics 1: Number of data s...