public inbox for glibc-cvs@sourceware.org
help / color / mirror / Atom feed
From: Wilco Dijkstra <wilco@sourceware.org>
To: glibc-cvs@sourceware.org
Subject: [glibc] Bump up the runtime for "short" benchmarks
Date: Fri, 28 Jun 2019 12:45:00 -0000	[thread overview]
Message-ID: <20190628124542.49587.qmail@sourceware.org> (raw)

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=afe23eb0f1942cb033ffdf3a338f669be4683f6c

commit afe23eb0f1942cb033ffdf3a338f669be4683f6c
Author: Anton Youdkevitch <anton.youdkevitch@bell-sw.com>
Date:   Fri Jun 28 13:38:07 2019 +0100

    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.

Diff:
---
 ChangeLog                    | 13 +++++++++++++
 benchtests/bench-memccpy.c   |  2 +-
 benchtests/bench-memchr.c    |  2 +-
 benchtests/bench-rawmemchr.c |  2 +-
 benchtests/bench-strcat.c    |  2 +-
 benchtests/bench-strchr.c    |  2 +-
 benchtests/bench-string.h    |  1 +
 benchtests/bench-strlen.c    |  2 +-
 benchtests/bench-strncpy.c   |  2 +-
 benchtests/bench-strnlen.c   |  2 +-
 10 files changed, 22 insertions(+), 8 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 65129ff..718829d 100644
--- a/ChangeLog
+++ b/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):
diff --git a/benchtests/bench-memccpy.c b/benchtests/bench-memccpy.c
index d3a2df5..46f96d5 100644
--- a/benchtests/bench-memccpy.c
+++ b/benchtests/bench-memccpy.c
@@ -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);
diff --git a/benchtests/bench-memchr.c b/benchtests/bench-memchr.c
index 9bd07eb..8a9909a 100644
--- a/benchtests/bench-memchr.c
+++ b/benchtests/bench-memchr.c
@@ -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);
diff --git a/benchtests/bench-rawmemchr.c b/benchtests/bench-rawmemchr.c
index 44f3114..5cdfdf7 100644
--- a/benchtests/bench-rawmemchr.c
+++ b/benchtests/bench-rawmemchr.c
@@ -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)
diff --git a/benchtests/bench-strcat.c b/benchtests/bench-strcat.c
index 39d9fef..08841d0 100644
--- a/benchtests/bench-strcat.c
+++ b/benchtests/bench-strcat.c
@@ -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)
diff --git a/benchtests/bench-strchr.c b/benchtests/bench-strchr.c
index b8dba17..10d06fe 100644
--- a/benchtests/bench-strchr.c
+++ b/benchtests/bench-strchr.c
@@ -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);
diff --git a/benchtests/bench-string.h b/benchtests/bench-string.h
index e7fb015..7d35791 100644
--- a/benchtests/bench-string.h
+++ b/benchtests/bench-string.h
@@ -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
 
diff --git a/benchtests/bench-strlen.c b/benchtests/bench-strlen.c
index 47363af..1997ad7 100644
--- a/benchtests/bench-strlen.c
+++ b/benchtests/bench-strlen.c
@@ -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)
diff --git a/benchtests/bench-strncpy.c b/benchtests/bench-strncpy.c
index 93bd6d5..c6a6799 100644
--- a/benchtests/bench-strncpy.c
+++ b/benchtests/bench-strncpy.c
@@ -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))
diff --git a/benchtests/bench-strnlen.c b/benchtests/bench-strnlen.c
index e9e51b2..72ec303 100644
--- a/benchtests/bench-strnlen.c
+++ b/benchtests/bench-strnlen.c
@@ -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)


                 reply	other threads:[~2019-06-28 12:45 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190628124542.49587.qmail@sourceware.org \
    --to=wilco@sourceware.org \
    --cc=glibc-cvs@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).