mirror of
https://sourceware.org/git/glibc.git
synced 2024-11-09 23:00:07 +00:00
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:
parent
507f55c05f
commit
afe23eb0f1
13
ChangeLog
13
ChangeLog
@ -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):
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
@ -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)
|
||||
|
@ -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)
|
||||
|
@ -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);
|
||||
|
@ -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
|
||||
|
||||
|
@ -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)
|
||||
|
@ -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))
|
||||
|
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user