Improve bench-strstr
commit93eebae5168e5cf2abfb4b6266e3fb2ab860cd60
authorWilco Dijkstra <wdijkstr@arm.com>
Tue, 9 Apr 2019 10:49:18 +0000 (9 11:49 +0100)
committerWilco Dijkstra <wdijkstr@arm.com>
Tue, 9 Apr 2019 10:49:18 +0000 (9 11:49 +0100)
tree35d49030fe55bc33b5f55c3e68adaadede82f209
parenta173d09f85a1f7e74e8b7ae7da04743a77cc7552
Improve bench-strstr

Improve bench-strstr by using an extract from the manual as the input
to make the test more realistic.  Use the same input for both found and
fail cases rather than using a memset of '0' for most of the string,
which measures performance of strchr rather than strstr.  Add result
checking to catch potential errors.  Remove the repeated tests at slightly
different alignments and add more large needle and haystack testcases.

Replace stupid_strstr with an efficient basic implementation.  Add the
Two-way implementation to simplify comparisons with much faster generic
implementations.

* benchtests/bench-strstr.c (input): Add realistic input text.
(stupid_strstr): Remove function.
(basic_strstr): Add function.
(twoway_strstr): Add function.
(do_one_test): Add result checking.
(do_test): Use new input text.  Remove accidental early matches.
(test_main): Improve range of tests, reduce unaligned cases.
ChangeLog
benchtests/bench-strstr.c