glibc/string
Wilco Dijkstra 284f42bc77 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.
2018-08-03 17:24:12 +01:00
..
bits
_strerror.c
argz-addsep.c
argz-append.c
argz-count.c
argz-create.c
argz-ctsep.c
argz-delete.c
argz-extract.c
argz-insert.c
argz-next.c Use libc_hidden_* for argz_next, __argz_next (bug 15105). 2018-02-15 21:00:02 +00:00
argz-replace.c
argz-stringify.c
argz.h
basename.c
bcopy.c
bug-envz1.c
bug-strcoll1.c
bug-strcoll2.c
bug-strncat1.c
bug-strpbrk1.c Fix bug-strspn1.c, bug-strpbrk1.c build with GCC mainline. 2018-06-20 22:18:22 +00:00
bug-strspn1.c Fix bug-strspn1.c, bug-strpbrk1.c build with GCC mainline. 2018-06-20 22:18:22 +00:00
bug-strtok1.c
byteswap.h
bzero.c
Depend
endian.h
envz.c
envz.h
explicit_bzero.c
ffs.c
ffsll.c
inl-tester.c
Makefile
memccpy.c
memchr.c
memcmp.c
memcpy.c
memfrob.c
memmem.c Improve strstr performance 2018-07-16 17:51:52 +01:00
memmove.c
memory.h
mempcpy.c
memrchr.c
memset.c
noinl-tester.c
rawmemchr.c
stpcpy.c
stpncpy.c
str-two-way.h Improve strstr performance 2018-07-16 17:51:52 +01:00
stratcliff.c
strcasecmp_l.c
strcasecmp.c
strcasestr.c Simplify and speedup strstr/strcasestr first match 2018-08-03 17:24:12 +01:00
strcat.c
strchr.c
strchrnul.c
strcmp.c
strcoll_l.c Fix another -Os strcoll build issue. 2018-02-26 18:38:01 +00:00
strcoll.c
strcpy.c
strcspn.c
strdup.c
strerror_l.c libc: Extend __libc_freeres framework (Bug 23329). 2018-06-29 22:39:06 -04:00
strerror.c
strfry.c
string-inlines.c
string.h
strings.h
strlen.c
strncase_l.c
strncase.c
strncat.c
strncmp.c
strncpy.c
strndup.c
strnlen.c
strpbrk.c
strrchr.c
strsep.c
strsignal.c
strspn.c
strstr.c Simplify and speedup strstr/strcasestr first match 2018-08-03 17:24:12 +01:00
strtok_r.c
strtok.c
strverscmp.c
strxfrm_l.c
strxfrm.c
swab.c
test-bcopy.c
test-bzero.c
test-endian-file-scope.c
test-endian-sign-conversion.c
test-endian-types.c
test-explicit_bzero.c
test-ffs.c
test-memccpy.c
test-memchr.c
test-memcmp.c
test-memcpy.c Add a test case for [BZ #23196] 2018-05-23 04:00:11 -07:00
test-memmem.c
test-memmove.c Fix i386 memmove issue (bug 22644). 2018-03-23 16:19:45 +01:00
test-mempcpy.c Don't write beyond destination in __mempcpy_avx512_no_vzeroupper (bug 23196) 2018-05-23 09:50:57 +02:00
test-memrchr.c
test-memset.c
test-rawmemchr.c
test-stpcpy.c
test-stpncpy.c
test-strcasecmp.c
test-strcasestr.c Improve strstr performance 2018-07-16 17:51:52 +01:00
test-strcat.c
test-strchr.c
test-strchrnul.c
test-strcmp.c
test-strcpy.c
test-strcspn.c
test-string.h
test-strlen.c
test-strncasecmp.c
test-strncat.c
test-strncmp.c
test-strncpy.c
test-strnlen.c
test-strpbrk.c
test-strrchr.c
test-strspn.c
test-strstr.c Improve strstr performance 2018-07-16 17:51:52 +01:00
testcopy.c
tester.c Ignore -Wrestrict for one strncat test. 2018-06-14 14:20:00 +00:00
tst-bswap.c
tst-cmp.c Fix tst-cmp.c build with GCC mainline. 2018-06-20 22:19:50 +00:00
tst-endian.c
tst-inlcall.c
tst-strcoll-overflow.c
tst-strfry.c
tst-strlen.c
tst-strtok_r.c
tst-strtok.c
tst-strxfrm2.c
tst-strxfrm.c
tst-svc2.c
tst-svc.c
tst-svc.expect
tst-svc.input
tst-xbzero-opt.c Fix string/tst-xbzero-opt if build with gcc head. 2018-07-26 17:09:44 +02:00
Versions
wordcopy.c
xpg-strerror.c