13#ifndef RTCTK_COMPONENTFRAMEWORK_TEST_REPOSITORYIFV2BENCH_HPP
14#define RTCTK_COMPONENTFRAMEWORK_TEST_REPOSITORYIFV2BENCH_HPP
18#include <benchmark/benchmark.h>
21static std::shared_ptr<RepositoryIf> MakeRepository();
24static void BM_WriteScalars(benchmark::State& state) {
28 auto repo = MakeRepository();
31 repo->CreateDataPoint(path, value);
33 for (
auto _ : state) {
34 repo->WriteDataPoint(path, value);
37 repo->DeleteDataPoint(path);
40static void BM_ReadScalars(benchmark::State& state) {
44 auto repo = MakeRepository();
47 repo->CreateDataPoint(path, value);
49 for (
auto _ : state) {
50 repo->ReadDataPoint(path, value);
53 repo->DeleteDataPoint(path);
56static void BM_WriteVectors(benchmark::State& state) {
60 auto repo = MakeRepository();
62 std::vector<uint8_t> value(state.range());
63 repo->CreateDataPoint(path, value);
65 for (
auto _ : state) {
66 repo->WriteDataPoint(path, value);
69 repo->DeleteDataPoint(path);
72static void BM_ReadVectors(benchmark::State& state) {
76 auto repo = MakeRepository();
78 std::vector<uint8_t> value(state.range());
79 repo->CreateDataPoint(path, value);
81 for (
auto _ : state) {
82 repo->ReadDataPoint(path, value);
85 repo->DeleteDataPoint(path);
91 ->ReportAggregatesOnly()
92 ->Unit(benchmark::kMillisecond);
97 ->ReportAggregatesOnly()
98 ->Unit(benchmark::kMillisecond);
104 ->Arg(10 * 1024 * 1024)
105 ->Arg(100 * 1024 * 1024)
106 ->Arg(400 * 1024 * 1024)
107 ->ReportAggregatesOnly()
108 ->Unit(benchmark::kMillisecond);
114 ->Arg(10 * 1024 * 1024)
115 ->Arg(100 * 1024 * 1024)
116 ->Arg(400 * 1024 * 1024)
117 ->ReportAggregatesOnly()
118 ->Unit(benchmark::kMillisecond);
This class provides a wrapper for a data point path.
Definition dataPointPath.hpp:74
Definition fakeClock.cpp:15
Definition commandReplier.cpp:22
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...