From 5de1508803bd1beeadd370ebac19e43b3232380b Mon Sep 17 00:00:00 2001 From: Wilco Dijkstra Date: Fri, 3 Mar 2023 13:03:19 +0000 Subject: 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 --- benchtests/bench-strpbrk.c | 23 +---------------------- 1 file changed, 1 insertion(+), 22 deletions(-) (limited to 'benchtests/bench-strpbrk.c') 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) -- cgit 1.4.1