Lines Matching +full:method +full:- +full:complexity
7 // http://www.apache.org/licenses/LICENSE-2.0
37 // via the --benchmarks command line flag. E.g.,
38 // my_unittest --benchmark_filter=all
39 // my_unittest --benchmark_filter=BM_StringCreation
40 // my_unittest --benchmark_filter=String
41 // my_unittest --benchmark_filter='Copy|Creation'
63 BENCHMARK(BM_memcpy)->Arg(8)->Arg(64)->Arg(512)->Arg(1<<10)->Arg(8<<10);
66 // following short-hand. The following invocation will pick a few
69 BENCHMARK(BM_memcpy)->Range(8, 8<<10);
85 ->Args({1<<10, 128})
86 ->Args({2<<10, 128})
87 ->Args({4<<10, 128})
88 ->Args({8<<10, 128})
89 ->Args({1<<10, 512})
90 ->Args({2<<10, 512})
91 ->Args({4<<10, 512})
92 ->Args({8<<10, 512});
95 // the following short-hand. The following macro will pick a few
98 BENCHMARK(BM_SetInsert)->Ranges({{1<<10, 8<<10}, {128, 512}});
108 b->Args({i, j});
110 BENCHMARK(BM_SetInsert)->Apply(CustomArguments);
119 for (int i = state.range(0); i--; )
121 for (int e = state.range(0); e--; )
128 BENCHMARK_TEMPLATE(BM_Sequential, WaitQueue<int>)->Range(1<<0, 1<<10);
136 BENCHMARK(BM_test)->MinTime(2.0); // Run for at least 2 seconds.
154 BENCHMARK(BM_MultiThreaded)->Threads(4);
161 BENCHMARK(BM_test)->Unit(benchmark::kMillisecond);
266 // Generate a list of benchmarks matching the specified --benchmark_filter flag
267 // and if --benchmark_list_tests is specified return after printing the name
274 // by '--benchmark_output'. If '--benchmark_output' is not given the
346 // FIXME Add ClobberMemory() for non-gnu and non-msvc compilers
349 // This class is used for user-defined counters.
357 // Mark the counter as a thread-average quantity. It will be
360 // Mark the counter as a thread-average rate. See above.
369 // Mark the counter as a iteration-average quantity.
372 // Mark the counter as a iteration-average rate. See above.
403 // This is the container for the user-defined counters.
412 // complexity for the benchmark. In case oAuto is selected, complexity will be
417 // computational complexity for the benchmark.
445 // The mode is user-specified.
446 // This may or may not be set when the following bit-flags are set.
467 // C++11 ranged-based for loop. These functions should not be called directly.
501 // NOTE: The "real time" measurement is per-thread. If different threads
525 // If the ranged-for style of benchmark loop is used, the user must explicitly
568 // If this routine is called with complexity_n > 0 and complexity report is
613 this->SetLabel(str.c_str()); in SetLabel()
634 return max_iterations - total_iterations_ + batch_leftover_; in iterations()
662 // Container for user-defined counters.
701 total_iterations_ -= n; in KeepRunningInternal()
707 total_iterations_ -= n; in KeepRunningInternal()
711 // For non-batch runs, total_iterations_ must be 0 by now. in KeepRunningInternal()
713 batch_leftover_ = n - total_iterations_; in KeepRunningInternal()
736 : cached_(st->error_occurred_ ? 0 : st->max_iterations), parent_(st) {} in StateIterator()
745 --cached_;
752 parent_->FinishKeepRunning();
773 // ------------------------------------------------------
777 // Each method returns "this" so that multiple method calls can
784 // method calls can be chained together in one expression.
846 // Set the range multiplier for non-dense range. If not called, the range
860 // `--benchmark_min_time=N` or `MinTime(...)` should be used instead.
878 // if for some reason CPU timings are not representative, call this method. If
886 // measured), call this method. If called, each benchmark iteration should
893 // Set the asymptotic computational complexity for the benchmark. If called
894 // the asymptotic computational complexity will be shown on the output.
895 Benchmark* Complexity(BigO complexity = benchmark::oAuto);
897 // Set the asymptotic computational complexity for the benchmark. If called
898 // the asymptotic computational complexity will be shown on the output.
899 Benchmark* Complexity(BigOFunc* complexity);
916 // BENCHMARK(Foo)->ThreadRange(1,16);
1054 this->SetUp(st); in Run()
1055 this->BenchmarkCase(st); in Run()
1056 this->TearDown(st); in Run()
1072 // ------------------------------------------------------
1099 // Old-style macros
1100 #define BENCHMARK_WITH_ARG(n, a) BENCHMARK(n)->Arg((a))
1101 #define BENCHMARK_WITH_ARG2(n, a1, a2) BENCHMARK(n)->Args({(a1), (a2)})
1102 #define BENCHMARK_WITH_UNIT(n, t) BENCHMARK(n)->Unit((t))
1103 #define BENCHMARK_RANGE(n, lo, hi) BENCHMARK(n)->Range((lo), (hi))
1105 BENCHMARK(n)->RangePair({{(l1), (h1)}, {(l2), (h2)}})
1158 #define BENCHMARK_PRIVATE_DECLARE_F(BaseClass, Method) \ argument
1159 class BaseClass##_##Method##_Benchmark : public BaseClass { \
1161 BaseClass##_##Method##_Benchmark() : BaseClass() { \
1162 this->SetName(#BaseClass "/" #Method); \
1169 #define BENCHMARK_TEMPLATE1_PRIVATE_DECLARE_F(BaseClass, Method, a) \ argument
1170 class BaseClass##_##Method##_Benchmark : public BaseClass<a> { \
1172 BaseClass##_##Method##_Benchmark() : BaseClass<a>() { \
1173 this->SetName(#BaseClass "<" #a ">/" #Method); \
1180 #define BENCHMARK_TEMPLATE2_PRIVATE_DECLARE_F(BaseClass, Method, a, b) \ argument
1181 class BaseClass##_##Method##_Benchmark : public BaseClass<a, b> { \
1183 BaseClass##_##Method##_Benchmark() : BaseClass<a, b>() { \
1184 this->SetName(#BaseClass "<" #a "," #b ">/" #Method); \
1192 #define BENCHMARK_TEMPLATE_PRIVATE_DECLARE_F(BaseClass, Method, ...) \ argument
1193 class BaseClass##_##Method##_Benchmark : public BaseClass<__VA_ARGS__> { \
1195 BaseClass##_##Method##_Benchmark() : BaseClass<__VA_ARGS__>() { \
1196 this->SetName(#BaseClass "<" #__VA_ARGS__ ">/" #Method); \
1207 #define BENCHMARK_DEFINE_F(BaseClass, Method) \ argument
1208 BENCHMARK_PRIVATE_DECLARE_F(BaseClass, Method) \
1209 void BaseClass##_##Method##_Benchmark::BenchmarkCase
1211 #define BENCHMARK_TEMPLATE1_DEFINE_F(BaseClass, Method, a) \ argument
1212 BENCHMARK_TEMPLATE1_PRIVATE_DECLARE_F(BaseClass, Method, a) \
1213 void BaseClass##_##Method##_Benchmark::BenchmarkCase
1215 #define BENCHMARK_TEMPLATE2_DEFINE_F(BaseClass, Method, a, b) \ argument
1216 BENCHMARK_TEMPLATE2_PRIVATE_DECLARE_F(BaseClass, Method, a, b) \
1217 void BaseClass##_##Method##_Benchmark::BenchmarkCase
1220 #define BENCHMARK_TEMPLATE_DEFINE_F(BaseClass, Method, ...) \ argument
1221 BENCHMARK_TEMPLATE_PRIVATE_DECLARE_F(BaseClass, Method, __VA_ARGS__) \
1222 void BaseClass##_##Method##_Benchmark::BenchmarkCase
1224 #define BENCHMARK_TEMPLATE_DEFINE_F(BaseClass, Method, a) \ argument
1225 BENCHMARK_TEMPLATE1_DEFINE_F(BaseClass, Method, a)
1228 #define BENCHMARK_REGISTER_F(BaseClass, Method) \ argument
1229 BENCHMARK_PRIVATE_REGISTER_F(BaseClass##_##Method##_Benchmark)
1236 #define BENCHMARK_F(BaseClass, Method) \ argument
1237 BENCHMARK_PRIVATE_DECLARE_F(BaseClass, Method) \
1238 BENCHMARK_REGISTER_F(BaseClass, Method); \
1239 void BaseClass##_##Method##_Benchmark::BenchmarkCase
1241 #define BENCHMARK_TEMPLATE1_F(BaseClass, Method, a) \ argument
1242 BENCHMARK_TEMPLATE1_PRIVATE_DECLARE_F(BaseClass, Method, a) \
1243 BENCHMARK_REGISTER_F(BaseClass, Method); \
1244 void BaseClass##_##Method##_Benchmark::BenchmarkCase
1246 #define BENCHMARK_TEMPLATE2_F(BaseClass, Method, a, b) \ argument
1247 BENCHMARK_TEMPLATE2_PRIVATE_DECLARE_F(BaseClass, Method, a, b) \
1248 BENCHMARK_REGISTER_F(BaseClass, Method); \
1249 void BaseClass##_##Method##_Benchmark::BenchmarkCase
1252 #define BENCHMARK_TEMPLATE_F(BaseClass, Method, ...) \ argument
1253 BENCHMARK_TEMPLATE_PRIVATE_DECLARE_F(BaseClass, Method, __VA_ARGS__) \
1254 BENCHMARK_REGISTER_F(BaseClass, Method); \
1255 void BaseClass##_##Method##_Benchmark::BenchmarkCase
1257 #define BENCHMARK_TEMPLATE_F(BaseClass, Method, a) \ argument
1258 BENCHMARK_TEMPLATE1_F(BaseClass, Method, a)
1270 // ------------------------------------------------------
1332 complexity(oNone), in Run()
1370 // Keep track of arguments to compute asymptotic complexity
1371 BigO complexity; member
1378 // Inform print function whether the current run is a complexity report
1403 // cpu-time and heap memory usage during the benchmark run. If the group
1408 // complexity and RMS of that benchmark family.
1437 // REQUIRES: 'out' is non-null.