File tree Expand file tree Collapse file tree 2 files changed +3
-13
lines changed
examples/google_benchmark_cmake Expand file tree Collapse file tree 2 files changed +3
-13
lines changed Original file line number Diff line number Diff line change @@ -19,18 +19,8 @@ NOINLINE static uint64_t recursive_fib(int n) {
19
19
}
20
20
21
21
NOINLINE static uint64_t expensive_operation () {
22
- // Large memory allocation
23
- std::vector<uint64_t > data (1024 * 1024 , 42 ); // 8 MiB allocation
24
-
25
- // Expensive recursive computation that will dominate flamegraph
26
- uint64_t fib_result = recursive_fib (30 );
27
-
28
- // More expensive work
29
- uint64_t sum = std::accumulate (data.begin (), data.end (), uint64_t (0 ));
30
- benchmark::DoNotOptimize (sum);
31
- benchmark::DoNotOptimize (fib_result);
32
-
33
- return sum + fib_result;
22
+ // Expensive recursive compuation that will dominate flamegraph
23
+ return 42 + recursive_fib (30 );
34
24
}
35
25
36
26
#endif // HELPER_HPP
Original file line number Diff line number Diff line change @@ -37,4 +37,4 @@ static void BM_large_setup(benchmark::State& state) {
37
37
benchmark::DoNotOptimize (actual_work ());
38
38
}
39
39
}
40
- BENCHMARK (BM_large_setup);
40
+ BENCHMARK (BM_large_setup)->Iterations( 100 ) ;
You can’t perform that action at this time.
0 commit comments