[glibc] benchtests: Increase iterations for strpbrk/strspn

Wilco Dijkstra via Glibc-cvs <[email protected]>
Newsgroups gmane.comp.lib.glibc.cvs
Message-ID <[email protected]>
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=c5c47f1b864a080d86f2d801d0effa8f1b402027

commit c5c47f1b864a080d86f2d801d0effa8f1b402027
Author: Wilco Dijkstra <[email protected]>
Date:   Mon Aug 17 13:19:25 2026 +0000

    benchtests: Increase iterations for strpbrk/strspn
    
    Increase iterations for strpbrk/strspn so they run for at least 0.5s.
    Reduce iterations for the much slower wcs* variants since they take over 10s.
    
    Reviewed-by: Adhemerval Zanella  <[email protected]>

Diff:
---
 benchtests/bench-strpbrk.c | 2 +-
 benchtests/bench-strspn.c  | 3 ++-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/benchtests/bench-strpbrk.c b/benchtests/bench-strpbrk.c
index 61607fde15..139cb7d689 100644
--- a/benchtests/bench-strpbrk.c
+++ b/benchtests/bench-strpbrk.c
@@ -48,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_ITERS8 / CHARBYTES;
+  size_t i, iters = CHARBYTES > 1 ? INNER_LOOP_ITERS : INNER_LOOP_ITERS_LARGE;
   timing_t start, stop, cur;
 
   if (res != exp_res)
diff --git a/benchtests/bench-strspn.c b/benchtests/bench-strspn.c
index e997d443fb..560bb5d77b 100644
--- a/benchtests/bench-strspn.c
+++ b/benchtests/bench-strspn.c
@@ -41,7 +41,8 @@ static void
 do_one_test (json_ctx_t *json_ctx, impl_t *impl, const CHAR *s,
              const CHAR *acc, size_t exp_res)
 {
-  size_t res = CALL (impl, s, acc), i, iters = INNER_LOOP_ITERS8 / CHARBYTES;
+  size_t res = CALL (impl, s, acc), i;
+  size_t iters = CHARBYTES > 1 ? INNER_LOOP_ITERS : INNER_LOOP_ITERS_LARGE;
   timing_t start, stop, cur;
 
   if (res != exp_res)
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.