Benchtests: Adjust timing

Adjust iteration counts so benchmarks don't run too slowly or quickly.
Ensure benchmarks take less than 10 seconds on older, slower cores and
more than 0.5 seconds on fast cores.

Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>
This commit is contained in:
Wilco Dijkstra 2023-03-21 14:00:22 +00:00
parent e275690332
commit 2623479105
11 changed files with 11 additions and 11 deletions

View File

@ -51,7 +51,7 @@ IMPL (memset_zero, 0)
static void
do_one_test (json_ctx_t *json_ctx, impl_t *impl, CHAR *s, size_t n)
{
size_t i, iters = INNER_LOOP_ITERS_LARGE;
size_t i, iters = INNER_LOOP_ITERS8;
timing_t start, stop, cur;
TIMING_NOW (start);

View File

@ -42,7 +42,7 @@ enum
{
NFIXED_ITERS = 1048576,
NRAND_BUFS = 16384,
NRAND_ITERS = 2048,
NRAND_ITERS = 256,
RAND_BENCH_MAX_LEN = 128
};

View File

@ -41,7 +41,7 @@ static void
do_one_test (impl_t *impl, void *dst, const void *src, int c, size_t len,
size_t n)
{
size_t i, iters = INNER_LOOP_ITERS_LARGE;
size_t i, iters = INNER_LOOP_ITERS_LARGE * 4;
timing_t start, stop, cur;
TIMING_NOW (start);

View File

@ -51,7 +51,7 @@ static void
do_one_test (json_ctx_t *json_ctx, impl_t *impl, const CHAR *s, int c,
size_t n)
{
size_t i, iters = INNER_LOOP_ITERS;
size_t i, iters = INNER_LOOP_ITERS8 / 2;
timing_t start, stop, cur;
TIMING_NOW (start);

View File

@ -127,7 +127,7 @@ do_one_test (json_ctx_t *json_ctx, impl_t *impl, char *dst, char *src,
copy_t *copy, size_t n)
{
timing_t start, stop, cur;
size_t iters = INNER_LOOP_ITERS_MEDIUM;
size_t iters = INNER_LOOP_ITERS_MEDIUM / 2;
for (int j = 0; j < n; j++)
CALL (impl, dst + copy[j].dst, src + copy[j].src, copy[j].len);

View File

@ -38,7 +38,7 @@ static void
do_one_test (json_ctx_t *json_ctx, impl_t *impl, char *dst, const char *src,
size_t len)
{
size_t i, iters = INNER_LOOP_ITERS;
size_t i, iters = INNER_LOOP_ITERS / 2;
timing_t start, stop, cur;
for (i = 0; i < iters / 64; ++i)
{

View File

@ -43,7 +43,7 @@ static void
do_one_test (json_ctx_t *json_ctx, impl_t *impl, CHAR *s,
int c __attribute ((unused)), size_t n)
{
size_t i, iters = INNER_LOOP_ITERS_LARGE;
size_t i, iters = INNER_LOOP_ITERS;
timing_t start, stop, cur;
TIMING_NOW (start);

View File

@ -52,7 +52,7 @@ IMPL (generic_strcat, 0)
static void
do_one_test (json_ctx_t *json_ctx, impl_t *impl, CHAR *dst, const CHAR *src)
{
size_t k = STRLEN (dst), i, iters = INNER_LOOP_ITERS_LARGE;
size_t k = STRLEN (dst), i, iters = INNER_LOOP_ITERS_LARGE / CHARBYTES;
timing_t start, stop, cur;
if (CALL (impl, dst, src) != dst)

View File

@ -50,7 +50,7 @@ do_one_test (json_ctx_t *json_ctx, impl_t *impl,
const CHAR *s1, const CHAR *s2,
int exp_result)
{
size_t i, iters = INNER_LOOP_ITERS;
size_t i, iters = INNER_LOOP_ITERS8 / 2;
timing_t start, stop, cur;
TIMING_NOW (start);

View File

@ -48,7 +48,7 @@ IMPL (STRLEN, 1)
static void
do_one_test (json_ctx_t *json_ctx, impl_t *impl, const CHAR *s, size_t exp_len)
{
size_t len = CALL (impl, s), i, iters = INNER_LOOP_ITERS8;
size_t len = CALL (impl, s), i, iters = INNER_LOOP_ITERS_LARGE;
timing_t start, stop, cur;
if (len != exp_len)

View File

@ -57,7 +57,7 @@ static void
do_one_test (json_ctx_t *json_ctx, impl_t *impl, CHAR *dst, const CHAR *src,
size_t len, size_t n)
{
size_t i, iters = INNER_LOOP_ITERS_LARGE * (4 / CHARBYTES);
size_t i, iters = INNER_LOOP_ITERS_LARGE / CHARBYTES;
timing_t start, stop, cur;
if (CALL (impl, dst, src, n) != STRNCPY_RESULT (dst, len, n))