|
1 | 1 | #include "benchmark_api_internal.h" |
2 | 2 |
|
3 | 3 | #include <cinttypes> |
| 4 | +#include <cstring> |
4 | 5 |
|
5 | 6 | #include "codspeed.h" |
6 | 7 | #include "string_util.h" |
@@ -100,11 +101,15 @@ State BenchmarkInstance::RunAnalysis( |
100 | 101 | // Do one repetition to avoid flakiness due to inconcistencies in CPU cache |
101 | 102 | // from execution order |
102 | 103 |
|
103 | | - internal::ThreadTimer warmup_timer = internal::ThreadTimer::Create(); |
104 | | - State warmup_state(name_.function_name, 1, args_, 0, 1, &warmup_timer, |
105 | | - manager, perf_counters_measurement, profiler_manager, |
106 | | - NULL, /*is_warmup=*/true ); |
107 | | - benchmark_.Run(warmup_state); |
| 104 | + // Only run the warmup in simulation mode. Removing this is a breaking change and has |
| 105 | + // to be properly planned and evaluated. |
| 106 | + if (strcmp(CODSPEED_MODE_DISPLAY, "memory") != 0) { |
| 107 | + internal::ThreadTimer warmup_timer = internal::ThreadTimer::Create(); |
| 108 | + State warmup_state(name_.function_name, 1, args_, 0, 1, &warmup_timer, |
| 109 | + manager, perf_counters_measurement, profiler_manager, |
| 110 | + NULL, /*is_warmup=*/true ); |
| 111 | + benchmark_.Run(warmup_state); |
| 112 | + } |
108 | 113 |
|
109 | 114 | State st(name().str(), 1, args_, 0, 1, timer, manager, |
110 | 115 | perf_counters_measurement, profiler_manager, codspeed); |
|
0 commit comments