• Home
  • Raw
  • Download

Lines Matching full:benchmark

22 #include "benchmark/benchmark.h"
30 void BM_Duration_Factory_Nanoseconds(benchmark::State& state) { in BM_Duration_Factory_Nanoseconds()
33 benchmark::DoNotOptimize(absl::Nanoseconds(i)); in BM_Duration_Factory_Nanoseconds()
37 BENCHMARK(BM_Duration_Factory_Nanoseconds);
39 void BM_Duration_Factory_Microseconds(benchmark::State& state) { in BM_Duration_Factory_Microseconds()
42 benchmark::DoNotOptimize(absl::Microseconds(i)); in BM_Duration_Factory_Microseconds()
46 BENCHMARK(BM_Duration_Factory_Microseconds);
48 void BM_Duration_Factory_Milliseconds(benchmark::State& state) { in BM_Duration_Factory_Milliseconds()
51 benchmark::DoNotOptimize(absl::Milliseconds(i)); in BM_Duration_Factory_Milliseconds()
55 BENCHMARK(BM_Duration_Factory_Milliseconds);
57 void BM_Duration_Factory_Seconds(benchmark::State& state) { in BM_Duration_Factory_Seconds()
60 benchmark::DoNotOptimize(absl::Seconds(i)); in BM_Duration_Factory_Seconds()
64 BENCHMARK(BM_Duration_Factory_Seconds);
66 void BM_Duration_Factory_Minutes(benchmark::State& state) { in BM_Duration_Factory_Minutes()
69 benchmark::DoNotOptimize(absl::Minutes(i)); in BM_Duration_Factory_Minutes()
73 BENCHMARK(BM_Duration_Factory_Minutes);
75 void BM_Duration_Factory_Hours(benchmark::State& state) { in BM_Duration_Factory_Hours()
78 benchmark::DoNotOptimize(absl::Hours(i)); in BM_Duration_Factory_Hours()
82 BENCHMARK(BM_Duration_Factory_Hours);
84 void BM_Duration_Factory_DoubleNanoseconds(benchmark::State& state) { in BM_Duration_Factory_DoubleNanoseconds()
87 benchmark::DoNotOptimize(absl::Nanoseconds(d)); in BM_Duration_Factory_DoubleNanoseconds()
91 BENCHMARK(BM_Duration_Factory_DoubleNanoseconds);
93 void BM_Duration_Factory_DoubleMicroseconds(benchmark::State& state) { in BM_Duration_Factory_DoubleMicroseconds()
96 benchmark::DoNotOptimize(absl::Microseconds(d)); in BM_Duration_Factory_DoubleMicroseconds()
100 BENCHMARK(BM_Duration_Factory_DoubleMicroseconds);
102 void BM_Duration_Factory_DoubleMilliseconds(benchmark::State& state) { in BM_Duration_Factory_DoubleMilliseconds()
105 benchmark::DoNotOptimize(absl::Milliseconds(d)); in BM_Duration_Factory_DoubleMilliseconds()
109 BENCHMARK(BM_Duration_Factory_DoubleMilliseconds);
111 void BM_Duration_Factory_DoubleSeconds(benchmark::State& state) { in BM_Duration_Factory_DoubleSeconds()
114 benchmark::DoNotOptimize(absl::Seconds(d)); in BM_Duration_Factory_DoubleSeconds()
118 BENCHMARK(BM_Duration_Factory_DoubleSeconds);
120 void BM_Duration_Factory_DoubleMinutes(benchmark::State& state) { in BM_Duration_Factory_DoubleMinutes()
123 benchmark::DoNotOptimize(absl::Minutes(d)); in BM_Duration_Factory_DoubleMinutes()
127 BENCHMARK(BM_Duration_Factory_DoubleMinutes);
129 void BM_Duration_Factory_DoubleHours(benchmark::State& state) { in BM_Duration_Factory_DoubleHours()
132 benchmark::DoNotOptimize(absl::Hours(d)); in BM_Duration_Factory_DoubleHours()
136 BENCHMARK(BM_Duration_Factory_DoubleHours);
142 void BM_Duration_Addition(benchmark::State& state) { in BM_Duration_Addition()
146 benchmark::DoNotOptimize(d += step); in BM_Duration_Addition()
149 BENCHMARK(BM_Duration_Addition);
151 void BM_Duration_Subtraction(benchmark::State& state) { in BM_Duration_Subtraction()
155 benchmark::DoNotOptimize(d -= step); in BM_Duration_Subtraction()
158 BENCHMARK(BM_Duration_Subtraction);
160 void BM_Duration_Multiplication_Fixed(benchmark::State& state) { in BM_Duration_Multiplication_Fixed()
165 benchmark::DoNotOptimize(s += d * (i + 1)); in BM_Duration_Multiplication_Fixed()
169 BENCHMARK(BM_Duration_Multiplication_Fixed);
171 void BM_Duration_Multiplication_Double(benchmark::State& state) { in BM_Duration_Multiplication_Double()
176 benchmark::DoNotOptimize(s += d * (i + 1.0)); in BM_Duration_Multiplication_Double()
180 BENCHMARK(BM_Duration_Multiplication_Double);
182 void BM_Duration_Division_Fixed(benchmark::State& state) { in BM_Duration_Division_Fixed()
186 benchmark::DoNotOptimize(d /= i + 1); in BM_Duration_Division_Fixed()
190 BENCHMARK(BM_Duration_Division_Fixed);
192 void BM_Duration_Division_Double(benchmark::State& state) { in BM_Duration_Division_Double()
196 benchmark::DoNotOptimize(d /= i + 1.0); in BM_Duration_Division_Double()
200 BENCHMARK(BM_Duration_Division_Double);
202 void BM_Duration_FDivDuration_Nanoseconds(benchmark::State& state) { in BM_Duration_FDivDuration_Nanoseconds()
206 benchmark::DoNotOptimize( in BM_Duration_FDivDuration_Nanoseconds()
211 BENCHMARK(BM_Duration_FDivDuration_Nanoseconds);
213 void BM_Duration_IDivDuration_Nanoseconds(benchmark::State& state) { in BM_Duration_IDivDuration_Nanoseconds()
218 benchmark::DoNotOptimize(a += in BM_Duration_IDivDuration_Nanoseconds()
224 BENCHMARK(BM_Duration_IDivDuration_Nanoseconds);
226 void BM_Duration_IDivDuration_Microseconds(benchmark::State& state) { in BM_Duration_IDivDuration_Microseconds()
231 benchmark::DoNotOptimize(a += absl::IDivDuration(absl::Microseconds(i), in BM_Duration_IDivDuration_Microseconds()
237 BENCHMARK(BM_Duration_IDivDuration_Microseconds);
239 void BM_Duration_IDivDuration_Milliseconds(benchmark::State& state) { in BM_Duration_IDivDuration_Milliseconds()
244 benchmark::DoNotOptimize(a += absl::IDivDuration(absl::Milliseconds(i), in BM_Duration_IDivDuration_Milliseconds()
250 BENCHMARK(BM_Duration_IDivDuration_Milliseconds);
252 void BM_Duration_IDivDuration_Seconds(benchmark::State& state) { in BM_Duration_IDivDuration_Seconds()
257 benchmark::DoNotOptimize( in BM_Duration_IDivDuration_Seconds()
262 BENCHMARK(BM_Duration_IDivDuration_Seconds);
264 void BM_Duration_IDivDuration_Minutes(benchmark::State& state) { in BM_Duration_IDivDuration_Minutes()
269 benchmark::DoNotOptimize( in BM_Duration_IDivDuration_Minutes()
274 BENCHMARK(BM_Duration_IDivDuration_Minutes);
276 void BM_Duration_IDivDuration_Hours(benchmark::State& state) { in BM_Duration_IDivDuration_Hours()
281 benchmark::DoNotOptimize( in BM_Duration_IDivDuration_Hours()
286 BENCHMARK(BM_Duration_IDivDuration_Hours);
288 void BM_Duration_ToInt64Nanoseconds(benchmark::State& state) { in BM_Duration_ToInt64Nanoseconds()
291 benchmark::DoNotOptimize(absl::ToInt64Nanoseconds(d)); in BM_Duration_ToInt64Nanoseconds()
294 BENCHMARK(BM_Duration_ToInt64Nanoseconds);
296 void BM_Duration_ToInt64Microseconds(benchmark::State& state) { in BM_Duration_ToInt64Microseconds()
299 benchmark::DoNotOptimize(absl::ToInt64Microseconds(d)); in BM_Duration_ToInt64Microseconds()
302 BENCHMARK(BM_Duration_ToInt64Microseconds);
304 void BM_Duration_ToInt64Milliseconds(benchmark::State& state) { in BM_Duration_ToInt64Milliseconds()
307 benchmark::DoNotOptimize(absl::ToInt64Milliseconds(d)); in BM_Duration_ToInt64Milliseconds()
310 BENCHMARK(BM_Duration_ToInt64Milliseconds);
312 void BM_Duration_ToInt64Seconds(benchmark::State& state) { in BM_Duration_ToInt64Seconds()
315 benchmark::DoNotOptimize(absl::ToInt64Seconds(d)); in BM_Duration_ToInt64Seconds()
318 BENCHMARK(BM_Duration_ToInt64Seconds);
320 void BM_Duration_ToInt64Minutes(benchmark::State& state) { in BM_Duration_ToInt64Minutes()
323 benchmark::DoNotOptimize(absl::ToInt64Minutes(d)); in BM_Duration_ToInt64Minutes()
326 BENCHMARK(BM_Duration_ToInt64Minutes);
328 void BM_Duration_ToInt64Hours(benchmark::State& state) { in BM_Duration_ToInt64Hours()
331 benchmark::DoNotOptimize(absl::ToInt64Hours(d)); in BM_Duration_ToInt64Hours()
334 BENCHMARK(BM_Duration_ToInt64Hours);
340 void BM_Duration_ToTimespec_AbslTime(benchmark::State& state) { in BM_Duration_ToTimespec_AbslTime()
343 benchmark::DoNotOptimize(absl::ToTimespec(d)); in BM_Duration_ToTimespec_AbslTime()
346 BENCHMARK(BM_Duration_ToTimespec_AbslTime);
355 void BM_Duration_ToTimespec_Double(benchmark::State& state) { in BM_Duration_ToTimespec_Double()
357 benchmark::DoNotOptimize(DoubleToTimespec(1.0)); in BM_Duration_ToTimespec_Double()
360 BENCHMARK(BM_Duration_ToTimespec_Double);
362 void BM_Duration_FromTimespec_AbslTime(benchmark::State& state) { in BM_Duration_FromTimespec_AbslTime()
371 benchmark::DoNotOptimize(absl::DurationFromTimespec(ts)); in BM_Duration_FromTimespec_AbslTime()
374 BENCHMARK(BM_Duration_FromTimespec_AbslTime);
380 void BM_Duration_FromTimespec_Double(benchmark::State& state) { in BM_Duration_FromTimespec_Double()
389 benchmark::DoNotOptimize(TimespecToDouble(ts)); in BM_Duration_FromTimespec_Double()
392 BENCHMARK(BM_Duration_FromTimespec_Double);
407 void BM_Duration_FormatDuration(benchmark::State& state) { in BM_Duration_FormatDuration()
413 benchmark::DoNotOptimize(absl::FormatDuration(d)); in BM_Duration_FormatDuration()
416 BENCHMARK(BM_Duration_FormatDuration)->DenseRange(0, kNumDurations - 1);
418 void BM_Duration_ParseDuration(benchmark::State& state) { in BM_Duration_ParseDuration()
423 benchmark::DoNotOptimize(absl::ParseDuration(s, &d)); in BM_Duration_ParseDuration()
426 BENCHMARK(BM_Duration_ParseDuration)->DenseRange(0, kNumDurations - 1);