diff options
author | Wilco Dijkstra <wdijkstr@arm.com> | 2019-06-11 15:52:21 +0100 |
---|---|---|
committer | Wilco Dijkstra <wdijkstr@arm.com> | 2019-06-11 15:52:21 +0100 |
commit | 80b2bfb5350442ef1a781b0ee9dd44d61bd88f8a (patch) | |
tree | 26b7514b56164261c5cf4870602ae06ab79cea42 /elf/vismain.c | |
parent | e6e24243905957c36596f50a22af0acfd83793e2 (diff) | |
download | glibc-80b2bfb5350442ef1a781b0ee9dd44d61bd88f8a.tar glibc-80b2bfb5350442ef1a781b0ee9dd44d61bd88f8a.tar.gz glibc-80b2bfb5350442ef1a781b0ee9dd44d61bd88f8a.tar.bz2 glibc-80b2bfb5350442ef1a781b0ee9dd44d61bd88f8a.zip |
Benchmark strstr hard needles
Benchmark needles which exhibit worst-case performance. This shows that
basic_strstr is quadratic and thus unsuitable for large needles.
On the other hand the Two-way and new strstr implementations are linear with
increasing needle sizes. The slowest cases of the two implementations are
within a factor of 2 on several different microarchitectures. Two-way is
slowest on inputs which cause a branch mispredict on almost every character.
The new strstr is slowest on inputs which almost match and result in many
calls to memcmp. Thanks to Szabolcs for providing various hard needles.
Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* benchtests/bench-strstr.c (test_hard_needle): New function.
Diffstat (limited to 'elf/vismain.c')
0 files changed, 0 insertions, 0 deletions