mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-20 07:16:55 +00:00
Run liboil benchmark multiple times
The statistics function requires multiple runs, otherwise it causes a divide by zero error.
This commit is contained in:
parent
528cdedc2b
commit
1dae15d762
1 changed files with 14 additions and 21 deletions
|
@ -1355,6 +1355,7 @@ _benchmark_integer_resampling (void)
|
||||||
OilProfile a, b;
|
OilProfile a, b;
|
||||||
gdouble av, bv;
|
gdouble av, bv;
|
||||||
SpeexResamplerState *sta, *stb;
|
SpeexResamplerState *sta, *stb;
|
||||||
|
int i;
|
||||||
|
|
||||||
oil_profile_init (&a);
|
oil_profile_init (&a);
|
||||||
oil_profile_init (&b);
|
oil_profile_init (&b);
|
||||||
|
@ -1372,29 +1373,21 @@ _benchmark_integer_resampling (void)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Warm up cache */
|
|
||||||
if (!_benchmark_int_float (sta))
|
|
||||||
goto error;
|
|
||||||
if (!_benchmark_int_float (sta))
|
|
||||||
goto error;
|
|
||||||
|
|
||||||
/* Benchmark */
|
/* Benchmark */
|
||||||
|
for (i = 0; i < 10; i++) {
|
||||||
oil_profile_start (&a);
|
oil_profile_start (&a);
|
||||||
if (!_benchmark_int_float (sta))
|
if (!_benchmark_int_float (sta))
|
||||||
goto error;
|
goto error;
|
||||||
oil_profile_stop (&a);
|
oil_profile_stop (&a);
|
||||||
|
}
|
||||||
/* Warm up cache */
|
|
||||||
if (!_benchmark_int_int (stb))
|
|
||||||
goto error;
|
|
||||||
if (!_benchmark_int_int (stb))
|
|
||||||
goto error;
|
|
||||||
|
|
||||||
/* Benchmark */
|
/* Benchmark */
|
||||||
|
for (i = 0; i < 10; i++) {
|
||||||
oil_profile_start (&b);
|
oil_profile_start (&b);
|
||||||
if (!_benchmark_int_int (stb))
|
if (!_benchmark_int_int (stb))
|
||||||
goto error;
|
goto error;
|
||||||
oil_profile_stop (&b);
|
oil_profile_stop (&b);
|
||||||
|
}
|
||||||
|
|
||||||
/* Handle results */
|
/* Handle results */
|
||||||
oil_profile_get_ave_std (&a, &av, NULL);
|
oil_profile_get_ave_std (&a, &av, NULL);
|
||||||
|
|
Loading…
Reference in a new issue