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] Benchtests: Remove memchr_strnlen
Date: Wed,  8 Mar 2023 18:46:41 +0000 (GMT)	[thread overview]
Message-ID: <20230308184641.2E7E13850846@sourceware.org> (raw)

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

commit b0e02d5b6d65cdfc972494484ef9a67b8e55e8f0
Author: Wilco Dijkstra <wilco.dijkstra@arm.com>
Date:   Fri Mar 3 12:57:49 2023 +0000

    Benchtests: Remove memchr_strnlen
    
    Remove memchr_strnlen since it is now the same as generic_strnlen.  Adjust
    iteration count to reduce benchmark time.  Keep memchr_strlen since the
    generic strlen does not use memchr.
    
    Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>

Diff:
---
 benchtests/bench-strlen.c  |  2 +-
 benchtests/bench-strnlen.c | 11 +----------
 2 files changed, 2 insertions(+), 11 deletions(-)

diff --git a/benchtests/bench-strlen.c b/benchtests/bench-strlen.c
index cae88dd6ec..9b91f8a10e 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_LARGE;
+  size_t len = CALL (impl, s), i, iters = INNER_LOOP_ITERS8;
   timing_t start, stop, cur;
 
   if (len != exp_len)
diff --git a/benchtests/bench-strnlen.c b/benchtests/bench-strnlen.c
index c997d7da4c..a1840afa85 100644
--- a/benchtests/bench-strnlen.c
+++ b/benchtests/bench-strnlen.c
@@ -22,7 +22,6 @@
 #else
 # define TEST_NAME "wcsnlen"
 # define generic_strnlen generic_wcsnlen
-# define memchr_strnlen wcschr_wcsnlen
 #endif /* WIDE */
 #include "bench-string.h"
 #include "json-lib.h"
@@ -38,22 +37,14 @@
 typedef size_t (*proto_t) (const CHAR *, size_t);
 size_t generic_strnlen (const CHAR *, size_t);
 
-size_t
-memchr_strnlen (const CHAR *s, size_t maxlen)
-{
-  const CHAR *s1 = MEMCHR (s, 0, maxlen);
-  return (s1 == NULL) ? maxlen : s1 - s;
-}
-
 IMPL (STRNLEN, 1)
-IMPL (memchr_strnlen, 0)
 IMPL (generic_strnlen, 0)
 
 static void
 do_one_test (json_ctx_t *json_ctx, 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_LARGE;
+  size_t len = CALL (impl, s, maxlen), i, iters = INNER_LOOP_ITERS;
   timing_t start, stop, cur;
 
   if (len != exp_len)

                 reply	other threads:[~2023-03-08 18:46 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=20230308184641.2E7E13850846@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).