about summary refs log tree commit diff
path: root/benchtests/bench-strpbrk.c
diff options
context:
space:
mode:
authorWilco Dijkstra <wilco.dijkstra@arm.com>2023-03-03 13:03:19 +0000
committerWilco Dijkstra <wilco.dijkstra@arm.com>2023-03-08 18:36:48 +0000
commit5de1508803bd1beeadd370ebac19e43b3232380b (patch)
tree763df389ac94b44743b13da43f3bc4d96a13bf2d /benchtests/bench-strpbrk.c
parentb0e02d5b6d65cdfc972494484ef9a67b8e55e8f0 (diff)
downloadglibc-5de1508803bd1beeadd370ebac19e43b3232380b.tar.gz
glibc-5de1508803bd1beeadd370ebac19e43b3232380b.tar.xz
glibc-5de1508803bd1beeadd370ebac19e43b3232380b.zip
Benchtests: Remove simple_strcspn/strpbrk/strsep
Remove simple_strcspn/strpbrk/strsep which are significantly slower than the
generic implementations.  Also remove oldstrsep and oldstrtok since they are
practically identical to the generic implementation.  Adjust iteration count
to reduce benchmark time.

Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>
Diffstat (limited to 'benchtests/bench-strpbrk.c')
-rw-r--r--benchtests/bench-strpbrk.c23
1 files changed, 1 insertions, 22 deletions
diff --git a/benchtests/bench-strpbrk.c b/benchtests/bench-strpbrk.c
index e96fb0efbf..55199b73c9 100644
--- a/benchtests/bench-strpbrk.c
+++ b/benchtests/bench-strpbrk.c
@@ -35,31 +35,10 @@
 # endif /* WIDE */
 # include "bench-string.h"
 
-# ifndef WIDE
-#  define SIMPLE_STRPBRK simple_strpbrk
-# else
-#  define SIMPLE_STRPBRK simple_wcspbrk
-# endif /* WIDE */
-
 typedef CHAR *(*proto_t) (const CHAR *, const CHAR *);
-CHAR *SIMPLE_STRPBRK (const CHAR *, const CHAR *);
 
-IMPL (SIMPLE_STRPBRK, 0)
 IMPL (STRPBRK, 1)
 
-CHAR *
-SIMPLE_STRPBRK (const CHAR *s, const CHAR *rej)
-{
-  const CHAR *r;
-  CHAR c;
-
-  while ((c = *s++) != '\0')
-    for (r = rej; *r != '\0'; ++r)
-      if (*r == c)
-	return (CHAR *) s - 1;
-  return NULL;
-}
-
 #endif /* !STRPBRK_RESULT */
 
 #include "json-lib.h"
@@ -69,7 +48,7 @@ do_one_test (json_ctx_t *json_ctx, impl_t *impl, const CHAR *s,
              const CHAR *rej, RES_TYPE exp_res)
 {
   RES_TYPE res = CALL (impl, s, rej);
-  size_t i, iters = INNER_LOOP_ITERS;
+  size_t i, iters = INNER_LOOP_ITERS8 / CHARBYTES;
   timing_t start, stop, cur;
 
   if (res != exp_res)