Go to the documentation of this file.
7 #include "benchmark/benchmark.h"
12 #define ADD_COMPLEXITY_CASES(...) \
13 int CONCAT(dummy, __LINE__) = AddComplexityTest(__VA_ARGS__)
19 {
"%bigo_name", big_o_test_name},
20 {
"%rms_name", rms_test_name},
21 {
"%bigo_str",
"[ ]* %float " + big_o},
23 {
"%rms",
"[ ]*[0-9]+ %"}});
26 {{
"^%bigo_name %bigo_str %bigo_str[ ]*$"},
28 {
"^%rms_name %rms %rms[ ]*$",
MR_Next}});
31 {{
"\"name\": \"%bigo_name\",$"},
33 {
"\"per_family_instance_index\": 0,$",
MR_Next},
34 {
"\"run_name\": \"%name\",$",
MR_Next},
35 {
"\"run_type\": \"aggregate\",$",
MR_Next},
36 {
"\"repetitions\": %int,$",
MR_Next},
38 {
"\"aggregate_name\": \"BigO\",$",
MR_Next},
39 {
"\"aggregate_unit\": \"time\",$",
MR_Next},
40 {
"\"cpu_coefficient\": %float,$",
MR_Next},
41 {
"\"real_coefficient\": %float,$",
MR_Next},
42 {
"\"big_o\": \"%bigo\",$",
MR_Next},
43 {
"\"time_unit\": \"ns\"$",
MR_Next},
45 {
"\"name\": \"%rms_name\",$"},
47 {
"\"per_family_instance_index\": 0,$",
MR_Next},
48 {
"\"run_name\": \"%name\",$",
MR_Next},
49 {
"\"run_type\": \"aggregate\",$",
MR_Next},
50 {
"\"repetitions\": %int,$",
MR_Next},
52 {
"\"aggregate_name\": \"RMS\",$",
MR_Next},
53 {
"\"aggregate_unit\": \"percentage\",$",
MR_Next},
56 AddCases(
TC_CSVOut, {{
"^\"%bigo_name\",,%float,%float,%bigo,,,,,$"},
57 {
"^\"%bigo_name\"",
MR_Not},
58 {
"^\"%rms_name\",,%float,%float,,,,,,$",
MR_Next}});
70 for (
int i = 0;
i < 1024; ++
i) {
110 v.reserve(
static_cast<int>(
size));
111 for (
int i = 0;
i <
size; ++
i) {
112 v.push_back(
static_cast<int>(std::rand() %
size));
128 ->Range(1 << 10, 1 << 16)
132 ->Range(1 << 10, 1 << 16)
134 return static_cast<double>(
n);
138 ->Range(1 << 10, 1 << 16)
162 std::sort(
v.begin(),
v.end());
166 static const double kLog2E = 1.44269504088896340736;
169 ->Range(1 << 10, 1 << 16)
173 ->Range(1 << 10, 1 << 16)
179 ->Range(1 << 10, 1 << 16)
212 ->Ranges({{1, 2}, {3, 4}});
215 "BM_ComplexityCaptureArgs/capture_test";
const char * big_o_1_test_name
static void ** find(grpc_chttp2_stream_map *map, uint32_t key)
#define ADD_COMPLEXITY_CASES(...)
const std::string complexity_capture_name
const char * auto_big_o_1
void BM_Complexity_O1(benchmark::State &state)
BENCHMARK_ALWAYS_INLINE void DoNotOptimize(Tp const &value)
BENCHMARK(BM_Complexity_O1) -> Range(1, 1<< 18) ->Complexity(benchmark::o1)
const char * big_o_n_test_name
static const double kLog2E
int SetSubstitutions(std::initializer_list< std::pair< std::string, std::string >> il)
const char * lambda_big_o_n_lg_n
int main(int argc, char *argv[])
const char * one_test_name
static void BM_Complexity_O_N_log_N(benchmark::State &state)
const char * enum_auto_big_o_n_lg_n
const char * enum_auto_big_o_n
int AddCases(TestCaseID ID, std::initializer_list< TestCase > il)
const char * enum_big_o_1
void BM_Complexity_O_N(benchmark::State &state)
const char * rms_o_1_test_name
void RunOutputTests(int argc, char *argv[])
const char * lambda_big_o_n
const char * big_o_n_lg_n_test_name
const char * rms_o_n_test_name
const char * rms_o_n_lg_n_test_name
const char * lambda_big_o_1
static bool to_string(zval *from)
std::vector< int > ConstructRandomVector(int64_t size)
void BM_ComplexityCaptureArgs(benchmark::State &state, int n)
const char * n_lg_n_test_name
grpc
Author(s):
autogenerated on Fri May 16 2025 02:58:00