Bump up the runtime for "short" benchmarks

Some benchmarks with a very short runtime show significantly
different results across runs on Aarch64 - up to tens of percents.
Increasing the runtime to 100ms+ makes the deviation under 5%.

Tested on Aarch64 and x86-64.

Reviewed-by: Carlos O'Donell <carlos@redhat.com>

	* benchtests/bench-memccpy.c: Replace INNER_LOOP_ITERS
	with INNER_LOOP_ITERS_LARGE.
	* benchtests/bench-memchr.c: Likewise.
	* benchtests/bench-rawmemchr.c: Likewise.
	* benchtests/bench-strcat.c: Likewise.
	* benchtests/bench-strchr.c: Likewise.
	* benchtests/bench-string.h: Likewise.
	* benchtests/bench-strlen.c: Likewise.
	* benchtests/bench-strncpy.c: Likewise.
	* benchtests/bench-strnlen.c: Likewise.
This commit is contained in:
Anton Youdkevitch 2019-06-28 13:38:07 +01:00 committed by Wilco Dijkstra
parent 507f55c05f
commit afe23eb0f1
10 changed files with 22 additions and 8 deletions

View File

@ -1,3 +1,16 @@
2019-06-28 Anton Youdkevitch <anton.youdkevitch@bell-sw.com>
* benchtests/bench-memccpy.c: Replace INNER_LOOP_ITERS
with INNER_LOOP_ITERS_LARGE.
* benchtests/bench-memchr.c: Likewise.
* benchtests/bench-rawmemchr.c: Likewise.
* benchtests/bench-strcat.c: Likewise.
* benchtests/bench-strchr.c: Likewise.
* benchtests/bench-string.h: Likewise.
* benchtests/bench-strlen.c: Likewise.
* benchtests/bench-strncpy.c: Likewise.
* benchtests/bench-strnlen.c: Likewise.
2019-06-28 Florian Weimer <fweimer@redhat.com>
* sysdeps/unix/sysv/linux/tst-getdents64.c (large_buffer_checks):

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;
size_t i, iters = INNER_LOOP_ITERS_LARGE;
timing_t start, stop, cur;
TIMING_NOW (start);

View File

@ -56,7 +56,7 @@ SIMPLE_MEMCHR (const CHAR *s, int c, size_t n)
static void
do_one_test (impl_t *impl, const CHAR *s, int c, size_t n)
{
size_t i, iters = INNER_LOOP_ITERS;
size_t i, iters = INNER_LOOP_ITERS_LARGE;
timing_t start, stop, cur;
TIMING_NOW (start);

View File

@ -39,7 +39,7 @@ IMPL (generic_rawmemchr, 0)
static void
do_one_test (impl_t *impl, const char *s, int c, char *exp_res)
{
size_t i, iters = INNER_LOOP_ITERS;
size_t i, iters = INNER_LOOP_ITERS_LARGE;
timing_t start, stop, cur;
char *res = CALL (impl, s, c);
if (res != exp_res)

View File

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

View File

@ -76,7 +76,7 @@ IMPL (STRCHR, 1)
static void
do_one_test (impl_t *impl, const CHAR *s, int c, const CHAR *exp_res)
{
size_t i, iters = INNER_LOOP_ITERS;
size_t i, iters = INNER_LOOP_ITERS_LARGE;
timing_t start, stop, cur;
TIMING_NOW (start);

View File

@ -125,6 +125,7 @@ extern impl_t __start_impls[], __stop_impls[];
# define OPT_SEED 10002
# define INNER_LOOP_ITERS 8192
# define INNER_LOOP_ITERS_LARGE 131072
# define INNER_LOOP_ITERS_MEDIUM 1024
# define INNER_LOOP_ITERS_SMALL 32

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_ITERS;
size_t len = CALL (impl, s), i, iters = INNER_LOOP_ITERS_LARGE;
timing_t start, stop, cur;
if (len != exp_len)

View File

@ -54,7 +54,7 @@ typedef CHAR *(*proto_t) (CHAR *, const CHAR *, size_t);
static void
do_one_test (impl_t *impl, CHAR *dst, const CHAR *src, size_t len, size_t n)
{
size_t i, iters = INNER_LOOP_ITERS;
size_t i, iters = INNER_LOOP_ITERS_LARGE;
timing_t start, stop, cur;
if (CALL (impl, dst, src, n) != STRNCPY_RESULT (dst, len, n))

View File

@ -51,7 +51,7 @@ IMPL (generic_strnlen, 0)
static void
do_one_test (impl_t *impl, const CHAR *s, size_t maxlen, size_t exp_len)
{
size_t len = CALL (impl, s, maxlen), i, iters = INNER_LOOP_ITERS;
size_t len = CALL (impl, s, maxlen), i, iters = INNER_LOOP_ITERS_LARGE;
timing_t start, stop, cur;
if (len != exp_len)