about summary refs log tree commit diff
path: root/signal/sys
diff options
context:
space:
mode:
authorWilco Dijkstra <wdijkstr@arm.com>2018-08-03 17:24:12 +0100
committerWilco Dijkstra <wdijkstr@arm.com>2018-08-03 17:24:12 +0100
commit284f42bc778e487dfd5dff5c01959f93b9e0c4f5 (patch)
tree4480c734a632b75194a0b4fd062b65057d6e2ad7 /signal/sys
parent430388d5dc0e1861b869096f4f5d946d7d74232a (diff)
downloadglibc-284f42bc778e487dfd5dff5c01959f93b9e0c4f5.tar.gz
glibc-284f42bc778e487dfd5dff5c01959f93b9e0c4f5.tar.xz
glibc-284f42bc778e487dfd5dff5c01959f93b9e0c4f5.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.
Diffstat (limited to 'signal/sys')
0 files changed, 0 insertions, 0 deletions