diff options
author | Wilco Dijkstra <wdijkstr@arm.com> | 2018-08-03 17:24:12 +0100 |
---|---|---|
committer | Wilco Dijkstra <wdijkstr@arm.com> | 2019-09-13 15:15:36 +0100 |
commit | 1def6a34aee55e26a0755a3e36bf2e184a4cdf5e (patch) | |
tree | 0a9ac229c86befa341b4f32af0f8b655f0684d9f /string/test-bcopy.c | |
parent | 1533274d5fd6eec6fd5972bc2f5c643261349c17 (diff) | |
download | glibc-1def6a34aee55e26a0755a3e36bf2e184a4cdf5e.tar.gz glibc-1def6a34aee55e26a0755a3e36bf2e184a4cdf5e.tar.xz glibc-1def6a34aee55e26a0755a3e36bf2e184a4cdf5e.zip |
Simplify and speedup strstr/strcasestr first match
Looking at the benchtests, both strstr and strcasestr spend a lot of time in a slow initialization loop handling one character per iteration. This can be simplified and use the much faster strlen/strnlen/strchr/memcmp. Read ahead a few cachelines to reduce the number of strnlen calls, which improves performance by ~3-4%. This patch improves the time taken for the full strstr benchtest by >40%. * string/strcasestr.c (STRCASESTR): Simplify and speedup first match. * string/strstr.c (AVAILABLE): Likewise. (cherry picked from commit 284f42bc778e487dfd5dff5c01959f93b9e0c4f5)
Diffstat (limited to 'string/test-bcopy.c')
0 files changed, 0 insertions, 0 deletions