Macros | Functions | Variables
protobuf/third_party/benchmark/test/complexity_test.cc File Reference
#include <algorithm>
#include <cassert>
#include <cmath>
#include <cstdlib>
#include <vector>
#include "benchmark/benchmark.h"
#include "output_test.h"
Include dependency graph for protobuf/third_party/benchmark/test/complexity_test.cc:

Go to the source code of this file.

Macros

#define ADD_COMPLEXITY_CASES(...)   int CONCAT(dummy, __LINE__) = AddComplexityTest(__VA_ARGS__)
 

Functions

 ADD_COMPLEXITY_CASES (big_o_1_test_name, rms_o_1_test_name, auto_big_o_1)
 
 ADD_COMPLEXITY_CASES (big_o_1_test_name, rms_o_1_test_name, enum_big_o_1)
 
 ADD_COMPLEXITY_CASES (big_o_1_test_name, rms_o_1_test_name, lambda_big_o_1)
 
 ADD_COMPLEXITY_CASES (big_o_n_lg_n_test_name, rms_o_n_lg_n_test_name, enum_auto_big_o_n_lg_n)
 
 ADD_COMPLEXITY_CASES (big_o_n_lg_n_test_name, rms_o_n_lg_n_test_name, lambda_big_o_n_lg_n)
 
 ADD_COMPLEXITY_CASES (big_o_n_test_name, rms_o_n_test_name, enum_auto_big_o_n)
 
 ADD_COMPLEXITY_CASES (big_o_n_test_name, rms_o_n_test_name, lambda_big_o_n)
 
 BENCHMARK (BM_Complexity_O1) -> Range(1, 1<< 18) ->Complexity(benchmark::o1)
 
void BM_Complexity_O1 (benchmark::State &state)
 
void BM_Complexity_O_N (benchmark::State &state)
 
static void BM_Complexity_O_N_log_N (benchmark::State &state)
 
std::vector< intConstructRandomVector (int size)
 
int main (int argc, char *argv[])
 
 RangeMultiplier (2) -> Range(1<< 10, 1<< 16) ->Complexity(benchmark::oN)
 

Variables

const char * auto_big_o_1 = "(\\([0-9]+\\))|(lgN)"
 
const char * big_o_1_test_name = "BM_Complexity_O1_BigO"
 
const char * big_o_n_lg_n_test_name = "BM_Complexity_O_N_log_N_BigO"
 
const char * big_o_n_test_name = "BM_Complexity_O_N_BigO"
 
const char * enum_auto_big_o_n = "N"
 
const char * enum_auto_big_o_n_lg_n = "NlgN"
 
const char * enum_big_o_1 = "\\([0-9]+\\)"
 
const char * lambda_big_o_1 = "f\\(N\\)"
 
const char * lambda_big_o_n = "f\\(N\\)"
 
const char * lambda_big_o_n_lg_n = "f\\(N\\)"
 
const char * rms_o_1_test_name = "BM_Complexity_O1_RMS"
 
const char * rms_o_n_lg_n_test_name = "BM_Complexity_O_N_log_N_RMS"
 
const char * rms_o_n_test_name = "BM_Complexity_O_N_RMS"
 

Macro Definition Documentation

◆ ADD_COMPLEXITY_CASES

#define ADD_COMPLEXITY_CASES (   ...)    int CONCAT(dummy, __LINE__) = AddComplexityTest(__VA_ARGS__)

Function Documentation

◆ ADD_COMPLEXITY_CASES() [1/7]

ADD_COMPLEXITY_CASES ( big_o_1_test_name  ,
rms_o_1_test_name  ,
auto_big_o_1   
)

◆ ADD_COMPLEXITY_CASES() [2/7]

ADD_COMPLEXITY_CASES ( big_o_1_test_name  ,
rms_o_1_test_name  ,
enum_big_o_1   
)

◆ ADD_COMPLEXITY_CASES() [3/7]

ADD_COMPLEXITY_CASES ( big_o_1_test_name  ,
rms_o_1_test_name  ,
lambda_big_o_1   
)

◆ ADD_COMPLEXITY_CASES() [4/7]

◆ ADD_COMPLEXITY_CASES() [5/7]

ADD_COMPLEXITY_CASES ( big_o_n_lg_n_test_name  ,
rms_o_n_lg_n_test_name  ,
lambda_big_o_n_lg_n   
)

◆ ADD_COMPLEXITY_CASES() [6/7]

ADD_COMPLEXITY_CASES ( big_o_n_test_name  ,
rms_o_n_test_name  ,
enum_auto_big_o_n   
)

◆ ADD_COMPLEXITY_CASES() [7/7]

ADD_COMPLEXITY_CASES ( big_o_n_test_name  ,
rms_o_n_test_name  ,
lambda_big_o_n   
)

◆ BENCHMARK()

BENCHMARK ( BM_Complexity_O1  ) -> Range(1, 1 << 18)->Complexity(benchmark::o1)

◆ BM_Complexity_O1()

void BM_Complexity_O1 ( benchmark::State state)

◆ BM_Complexity_O_N()

void BM_Complexity_O_N ( benchmark::State state)

◆ BM_Complexity_O_N_log_N()

static void BM_Complexity_O_N_log_N ( benchmark::State state)
static

◆ ConstructRandomVector()

std::vector<int> ConstructRandomVector ( int  size)

◆ main()

int main ( int  argc,
char *  argv[] 
)

◆ RangeMultiplier()

RangeMultiplier ( ) -> Range(1<< 10, 1<< 16) ->Complexity(benchmark::oN)

Variable Documentation

◆ auto_big_o_1

const char* auto_big_o_1 = "(\\([0-9]+\\))|(lgN)"

◆ big_o_1_test_name

const char* big_o_1_test_name = "BM_Complexity_O1_BigO"

◆ big_o_n_lg_n_test_name

const char* big_o_n_lg_n_test_name = "BM_Complexity_O_N_log_N_BigO"

◆ big_o_n_test_name

const char* big_o_n_test_name = "BM_Complexity_O_N_BigO"

◆ enum_auto_big_o_n

const char* enum_auto_big_o_n = "N"

◆ enum_auto_big_o_n_lg_n

const char* enum_auto_big_o_n_lg_n = "NlgN"

◆ enum_big_o_1

const char* enum_big_o_1 = "\\([0-9]+\\)"

◆ lambda_big_o_1

const char* lambda_big_o_1 = "f\\(N\\)"

◆ lambda_big_o_n

const char* lambda_big_o_n = "f\\(N\\)"

◆ lambda_big_o_n_lg_n

const char* lambda_big_o_n_lg_n = "f\\(N\\)"

◆ rms_o_1_test_name

const char* rms_o_1_test_name = "BM_Complexity_O1_RMS"

◆ rms_o_n_lg_n_test_name

const char* rms_o_n_lg_n_test_name = "BM_Complexity_O_N_log_N_RMS"

◆ rms_o_n_test_name

const char* rms_o_n_test_name = "BM_Complexity_O_N_RMS"


grpc
Author(s):
autogenerated on Fri May 16 2025 03:01:07