Improve string benchtest timing

System Internals / glibc - Wilco Dijkstra [arm.com] - 21 May 2019 14:19 EDT

. Many tests run for 0.01s which is way too short to give accurate results. Other tests take over 40 seconds which is way too long. Significantly increase the iterations of the short running tests. Reduce number of alignment variations in the long running memcpy walk tests so they take less than 5 seconds.

As a result most tests take at least 0.1s and all finish within 5 seconds.

- benchtests/bench-memcpy-random.c (do_one_test): Use medium iterations.
- benchtests/bench-memcpy-walk.c (test_main): Reduce alignment tests.
- benchtests/bench-memmem.c (do_one_test): Use small iterations.
- benchtests/bench-memmove-walk.c (test_main): Reduce alignment tests.
- benchtests/bench-memset-walk.c (test_main): Reduce alignment tests.
- benchtests/bench-strcasestr.c (do_one_test): Use small iterations.
- benchtests/bench-string.h (INNER_LOOP_ITERS): Increase iterations. (INNER_LOOP_ITERS_MEDIUM): New define. (INNER_LOOP_ITERS_SMALL): New define.
- benchtests/bench-strpbrk.c (do_one_test): Use medium iterations.
- benchtests/bench-strsep.c (do_one_test): Use small iterations.
- benchtests/bench-strspn.c (do_one_test): Use medium iterations.
- benchtests/bench-strstr.c (do_one_test): Use small iterations.
- benchtests/bench-strtok.c (do_one_test): Use small iterations.

46ae07324b Improve string benchtest timing
ChangeLog | 17 +++++++++++++++++
benchtests/bench-memcpy-random.c | 2 +-
benchtests/bench-memcpy-walk.c | 8 ++------
benchtests/bench-memmem.c | 2 +-
benchtests/bench-memmove-walk.c | 16 ++++------------
benchtests/bench-memset-walk.c | 13 ++++++++-----
benchtests/bench-strcasestr.c | 2 +-
benchtests/bench-string.h | 4 +++-
benchtests/bench-strpbrk.c | 2 +-
benchtests/bench-strsep.c | 2 +-
benchtests/bench-strspn.c | 2 +-
benchtests/bench-strstr.c | 2 +-
benchtests/bench-strtok.c | 2 +-
13 files changed, 42 insertions(+), 32 deletions(-)

Upstream: sourceware.org


  • Share