diff options
author | Wilco Dijkstra <wilco.dijkstra@arm.com> | 2023-03-03 13:03:19 +0000 |
---|---|---|
committer | Wilco Dijkstra <wilco.dijkstra@arm.com> | 2023-03-08 18:36:48 +0000 |
commit | 5de1508803bd1beeadd370ebac19e43b3232380b (patch) | |
tree | 763df389ac94b44743b13da43f3bc4d96a13bf2d /benchtests/bench-strspn.c | |
parent | b0e02d5b6d65cdfc972494484ef9a67b8e55e8f0 (diff) | |
download | glibc-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-strspn.c')
-rw-r--r-- | benchtests/bench-strspn.c | 23 |
1 files changed, 1 insertions, 22 deletions
diff --git a/benchtests/bench-strspn.c b/benchtests/bench-strspn.c index 707613cbcf..cc98ffb38b 100644 --- a/benchtests/bench-strspn.c +++ b/benchtests/bench-strspn.c @@ -28,41 +28,20 @@ #define BIG_CHAR MAX_CHAR #ifndef WIDE -# define SIMPLE_STRSPN simple_strspn # define SMALL_CHAR 127 #else -# define SIMPLE_STRSPN simple_wcsspn # define SMALL_CHAR 1273 #endif /* WIDE */ typedef size_t (*proto_t) (const CHAR *, const CHAR *); -size_t SIMPLE_STRSPN (const CHAR *, const CHAR *); -IMPL (SIMPLE_STRSPN, 0) IMPL (STRSPN, 1) -size_t -SIMPLE_STRSPN (const CHAR *s, const CHAR *acc) -{ - const CHAR *r, *str = s; - CHAR c; - - while ((c = *s++) != '\0') - { - for (r = acc; *r != '\0'; ++r) - if (*r == c) - break; - if (*r == '\0') - return s - str - 1; - } - return s - str - 1; -} - 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_ITERS; + size_t res = CALL (impl, s, acc), i, iters = INNER_LOOP_ITERS8 / CHARBYTES; timing_t start, stop, cur; if (res != exp_res) |