-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathmicro_benchmark_n16.cpp
More file actions
197 lines (166 loc) · 6.62 KB
/
micro_benchmark_n16.cpp
File metadata and controls
197 lines (166 loc) · 6.62 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
// Copyright 2020-2025 UnoDB contributors
// Should be the first include
#include "global.hpp" // IWYU pragma: keep
#include <benchmark/benchmark.h>
#include "micro_benchmark_node_utils.hpp"
#include "micro_benchmark_utils.hpp"
namespace {
template <class Db>
void grow_n4_to_n16_sequentially(benchmark::State& state) {
unodb::benchmark::grow_node_sequentially_benchmark<Db, 4>(state);
}
template <class Db>
void grow_n4_to_n16_randomly(benchmark::State& state) {
unodb::benchmark::grow_node_randomly_benchmark<Db, 4>(state);
}
template <class Db>
void n16_sequential_add(benchmark::State& state) {
unodb::benchmark::sequential_add_benchmark<Db, 16>(state);
}
template <class Db>
void n16_random_add(benchmark::State& state) {
unodb::benchmark::random_add_benchmark<Db, 16>(state);
}
template <class Db>
void minimal_n16_tree_full_scan(benchmark::State& state) {
unodb::benchmark::minimal_tree_full_scan<Db, 16>(state);
}
template <class Db>
void minimal_n16_tree_random_gets(benchmark::State& state) {
unodb::benchmark::minimal_tree_random_gets<Db, 16>(state);
}
template <class Db>
void full_n16_tree_full_scan(benchmark::State& state) {
unodb::benchmark::full_node_scan_benchmark<Db, 16>(state);
}
template <class Db>
void full_n16_tree_random_gets(benchmark::State& state) {
unodb::benchmark::full_node_random_get_benchmark<Db, 16>(state);
}
template <class Db>
void full_n16_tree_sequential_delete(benchmark::State& state) {
unodb::benchmark::sequential_delete_benchmark<Db, 16>(state);
}
template <class Db>
void full_n16_tree_random_delete(benchmark::State& state) {
unodb::benchmark::random_delete_benchmark<Db, 16>(state);
}
template <class Db>
void shrink_n48_to_n16_sequentially(benchmark::State& state) {
unodb::benchmark::shrink_node_sequentially_benchmark<Db, 16>(state);
}
template <class Db>
void shrink_n48_to_n16_randomly(benchmark::State& state) {
unodb::benchmark::shrink_node_randomly_benchmark<Db, 16>(state);
}
} // namespace
UNODB_START_BENCHMARKS()
BENCHMARK_TEMPLATE(grow_n4_to_n16_sequentially, unodb::benchmark::db)
->Range(20, 16383)
->Unit(benchmark::kMicrosecond);
BENCHMARK_TEMPLATE(grow_n4_to_n16_sequentially, unodb::benchmark::mutex_db)
->Range(20, 16383)
->Unit(benchmark::kMicrosecond);
BENCHMARK_TEMPLATE(grow_n4_to_n16_sequentially, unodb::benchmark::olc_db)
->Range(20, 16383)
->Unit(benchmark::kMicrosecond);
BENCHMARK_TEMPLATE(grow_n4_to_n16_randomly, unodb::benchmark::db)
->Range(20, 16383)
->Unit(benchmark::kMicrosecond);
BENCHMARK_TEMPLATE(grow_n4_to_n16_randomly, unodb::benchmark::mutex_db)
->Range(20, 16383)
->Unit(benchmark::kMicrosecond);
BENCHMARK_TEMPLATE(grow_n4_to_n16_randomly, unodb::benchmark::olc_db)
->Range(20, 16383)
->Unit(benchmark::kMicrosecond);
BENCHMARK_TEMPLATE(n16_sequential_add, unodb::benchmark::db)
->Range(10, 16383)
->Unit(benchmark::kMicrosecond);
BENCHMARK_TEMPLATE(n16_sequential_add, unodb::benchmark::mutex_db)
->Range(10, 16383)
->Unit(benchmark::kMicrosecond);
BENCHMARK_TEMPLATE(n16_sequential_add, unodb::benchmark::olc_db)
->Range(10, 16383)
->Unit(benchmark::kMicrosecond);
BENCHMARK_TEMPLATE(n16_random_add, unodb::benchmark::db)
->Range(10, 16383)
->Unit(benchmark::kMicrosecond);
BENCHMARK_TEMPLATE(n16_random_add, unodb::benchmark::mutex_db)
->Range(10, 16383)
->Unit(benchmark::kMicrosecond);
BENCHMARK_TEMPLATE(n16_random_add, unodb::benchmark::olc_db)
->Range(10, 16383)
->Unit(benchmark::kMicrosecond);
BENCHMARK_TEMPLATE(minimal_n16_tree_full_scan, unodb::benchmark::db)
->Range(10, 16383)
->Unit(benchmark::kMicrosecond);
BENCHMARK_TEMPLATE(minimal_n16_tree_full_scan, unodb::benchmark::mutex_db)
->Range(10, 16383)
->Unit(benchmark::kMicrosecond);
BENCHMARK_TEMPLATE(minimal_n16_tree_full_scan, unodb::benchmark::olc_db)
->Range(10, 16383)
->Unit(benchmark::kMicrosecond);
BENCHMARK_TEMPLATE(minimal_n16_tree_random_gets, unodb::benchmark::db)
->Range(10, 16383)
->Unit(benchmark::kMicrosecond);
BENCHMARK_TEMPLATE(minimal_n16_tree_random_gets, unodb::benchmark::mutex_db)
->Range(10, 16383)
->Unit(benchmark::kMicrosecond);
BENCHMARK_TEMPLATE(minimal_n16_tree_random_gets, unodb::benchmark::olc_db)
->Range(10, 16383)
->Unit(benchmark::kMicrosecond);
BENCHMARK_TEMPLATE(full_n16_tree_full_scan, unodb::benchmark::db)
->Range(64, 246000)
->Unit(benchmark::kMicrosecond);
BENCHMARK_TEMPLATE(full_n16_tree_full_scan, unodb::benchmark::mutex_db)
->Range(64, 246000)
->Unit(benchmark::kMicrosecond);
BENCHMARK_TEMPLATE(full_n16_tree_full_scan, unodb::benchmark::olc_db)
->Range(64, 246000)
->Unit(benchmark::kMicrosecond);
BENCHMARK_TEMPLATE(full_n16_tree_random_gets, unodb::benchmark::db)
->Range(64, 24600)
->Unit(benchmark::kMicrosecond);
BENCHMARK_TEMPLATE(full_n16_tree_random_gets, unodb::benchmark::mutex_db)
->Range(64, 24600)
->Unit(benchmark::kMicrosecond);
BENCHMARK_TEMPLATE(full_n16_tree_random_gets, unodb::benchmark::olc_db)
->Range(64, 24600)
->Unit(benchmark::kMicrosecond);
BENCHMARK_TEMPLATE(full_n16_tree_sequential_delete, unodb::benchmark::db)
->Range(64, 246000)
->Unit(benchmark::kMicrosecond);
BENCHMARK_TEMPLATE(full_n16_tree_sequential_delete, unodb::benchmark::mutex_db)
->Range(64, 246000)
->Unit(benchmark::kMicrosecond);
BENCHMARK_TEMPLATE(full_n16_tree_sequential_delete, unodb::benchmark::olc_db)
->Range(64, 246000)
->Unit(benchmark::kMicrosecond);
BENCHMARK_TEMPLATE(full_n16_tree_random_delete, unodb::benchmark::db)
->Range(64, 246000)
->Unit(benchmark::kMicrosecond);
BENCHMARK_TEMPLATE(full_n16_tree_random_delete, unodb::benchmark::mutex_db)
->Range(64, 246000)
->Unit(benchmark::kMicrosecond);
BENCHMARK_TEMPLATE(full_n16_tree_random_delete, unodb::benchmark::olc_db)
->Range(64, 246000)
->Unit(benchmark::kMicrosecond);
BENCHMARK_TEMPLATE(shrink_n48_to_n16_sequentially, unodb::benchmark::db)
->Range(4, 16383)
->Unit(benchmark::kMicrosecond);
BENCHMARK_TEMPLATE(shrink_n48_to_n16_sequentially, unodb::benchmark::mutex_db)
->Range(4, 16383)
->Unit(benchmark::kMicrosecond);
BENCHMARK_TEMPLATE(shrink_n48_to_n16_sequentially, unodb::benchmark::olc_db)
->Range(4, 16383)
->Unit(benchmark::kMicrosecond);
BENCHMARK_TEMPLATE(shrink_n48_to_n16_randomly, unodb::benchmark::db)
->Range(4, 16383)
->Unit(benchmark::kMicrosecond);
BENCHMARK_TEMPLATE(shrink_n48_to_n16_randomly, unodb::benchmark::mutex_db)
->Range(4, 16383)
->Unit(benchmark::kMicrosecond);
BENCHMARK_TEMPLATE(shrink_n48_to_n16_randomly, unodb::benchmark::olc_db)
->Range(4, 16383)
->Unit(benchmark::kMicrosecond);
UNODB_BENCHMARK_MAIN();