mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-03-12 18:55:12 +01:00
gobject/performance: drop wrong additional warm up during test run
For the test, we actually care to find the fastest test run (and take "min_elapsed"). That is useful, because that is the run where we possibly have the least interference from external factors, it was the run where the CPU solved the problem as fast as it could. As such, we should not reject the first 5% as additional warm up. If the first 5% are slower (and part of "warmup"), then they are anyway not considered. If there is a the fastest run in the first 5 percent, then we want to take that. Also note, that the calculation of "avg_elapsed" was wrong, since it divided by the full "num_rounds" while only summing 95% of the runs. This is fixed too by now considering all runs. Fixes: 282d536fd229 ('tests/performance: ensure to always warm up for 2 seconds')
This commit is contained in:
parent
22c1762dff
commit
1527e1a448
@ -189,12 +189,6 @@ run_test (PerformanceTest *test)
|
||||
g_timer_stop (timer);
|
||||
test->finish (test, data);
|
||||
|
||||
if (i < num_rounds / 20)
|
||||
{
|
||||
/* The first 5% are additional warm up. Ignore. */
|
||||
continue;
|
||||
}
|
||||
|
||||
elapsed = g_timer_elapsed (timer, NULL);
|
||||
|
||||
min_elapsed = MIN (min_elapsed, elapsed);
|
||||
|
Loading…
x
Reference in New Issue
Block a user