Skip to content

Commit 55065d7

Browse files
authored
Merge pull request #289 from HeatCrab/add-warmup-to-measurement
Introduce Warm-up Phase for Dudect Measurement
2 parents 564b805 + a51c643 commit 55065d7

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

dudect/fixture.c

+14-2
Original file line numberDiff line numberDiff line change
@@ -196,8 +196,20 @@ static bool doit(int mode)
196196
bool ret = measure(before_ticks, after_ticks, input_data, mode);
197197
differentiate(exec_times, before_ticks, after_ticks);
198198
prepare_percentiles(exec_times, percentiles);
199-
update_statistics(exec_times, classes, percentiles);
200-
ret &= report();
199+
200+
/* This warm-up step discards the first measurement batch by skipping
201+
* its statistical analysis. A static boolean flag controls this by
202+
* marking the initial execution, ensuring only the first call within
203+
* a test run is excluded from the t-test computation.
204+
*/
205+
static bool first_time = true;
206+
if (first_time) {
207+
first_time = false;
208+
ret = true;
209+
} else {
210+
update_statistics(exec_times, classes, percentiles);
211+
ret &= report();
212+
}
201213

202214
free(before_ticks);
203215
free(after_ticks);

0 commit comments

Comments
 (0)