aboutsummaryrefslogtreecommitdiff
path: root/ChangeLog
diff options
context:
space:
mode:
authorWilco Dijkstra <wdijkstr@arm.com>2018-07-16 17:50:09 +0100
committerWilco Dijkstra <wdijkstr@arm.com>2018-07-16 17:51:52 +0100
commit3ae725dfb6d7f61447d27d00ed83e573bd5454f4 (patch)
tree1a0eada529fc06de4613cb84a20d80e5d69c6d0a /ChangeLog
parent31e422ca9680bbe412aa56b23f058c10eaee7be8 (diff)
downloadglibc-3ae725dfb6d7f61447d27d00ed83e573bd5454f4.tar
glibc-3ae725dfb6d7f61447d27d00ed83e573bd5454f4.tar.gz
glibc-3ae725dfb6d7f61447d27d00ed83e573bd5454f4.tar.bz2
glibc-3ae725dfb6d7f61447d27d00ed83e573bd5454f4.zip
Improve strstr performance
Improve strstr performance. Strstr tends to be slow because it uses many calls to memchr and a slow byte loop to scan for the next match. Performance is significantly improved by using strnlen on larger blocks and using strchr to search for the next matching character. strcasestr can also use strnlen to scan ahead, and memmem can use memchr to check for the next match. On the GLIBC bench tests the performance gains on Cortex-A72 are: strstr: +25% strcasestr: +4.3% memmem: +18% On a 256KB dataset strstr performance improves by 67%, strcasestr by 47%. Reviewd-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Diffstat (limited to 'ChangeLog')
-rw-r--r--ChangeLog13
1 files changed, 13 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 89052e6a9f..b921f90666 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,16 @@
+2018-07-15 Wilco Dijkstra <wdijkstr@arm.com>
+
+ * benchtests/bench-strcasestr.c: Rename __strnlen to strnlen.
+ * benchtests/bench-strstr.c: Likewise.
+ * string/memmem.c (FASTSEARCH): Define.
+ * string/str-two-way.h (two_way_short_needle): Minor cleanups.
+ Add support for FASTSEARCH.
+ * string/strcasestr.c (AVAILABLE): Use read-ahead __strnlen.
+ * string/strstr.c (AVAILABLE): Use read-ahead __strnlen.
+ (FASTSEARCH): Define.
+ * string/test-strcasestr.c: Rename __strnlen to strnlen.
+ * string/test-strstr.c: Likewise.
+
2018-07-15 H.J. Lu <hongjiu.lu@intel.com>
* sysdeps/unix/sysv/linux/x86_64/____longjmp_chk.S: Undef