glibc/sysdeps
Wilco Dijkstra 5625f666ce This patch cleans up the strsep implementation and improves performance.
Currently strsep calls strpbrk is is now a veneer to strcspn.  Calling
strcspn directly is faster.  Since it handles a delimiter string of size
1 as a special case, this is not needed in strsep itself.  Although this
means there is a slightly higher overhead if the delimiter size is 1,
all other cases are slightly faster.  The overall performance gain is 5-10%
on AArch64.

The string/bits/string2.h header contains optimizations for constant
delimiters of size 1-3.  Benchmarking these showed similar performance for
size 1 (since in all cases strchr/strchrnul is used), while size 2 and 3
can give up to 2x speedup for small input strings.  However if these cases
are common it seems much better to add this optimization to strcspn.
So move these header optimizations to string-inlines.c.

Improve the strsep benchmark so that it actually benchmarks something.
The current version contains a delimiter character at every position in the
input string, so there is very little work to do, and the extremely inefficent
simple_strsep implementation appears fastest in every case.  The new version
has either no match in the input for the fail case and a match halfway in the
input for the success case.  The input is then restored so that each iteration
does exactly the same amount of work.  Reduce the number of testcases since
simple_strsep takes a lot of time now.

	* benchtests/bench-strsep.c (oldstrsep): Add old implementation.
	(do_one_test) Restore original string so iteration works.
	* string/string-inlines.c (do_test): Create better input strings.
	(test_main) Reduce number of testruns.
	* string/string-inlines.c (__old_strsep_1c): New function.
	(__old_strsep_2c): Likewise.
	(__old_strsep_3c): Likewise.
	* string/strsep.c (__strsep): Remove case of small delim string.
	Call strcspn directly rather than strpbrk.
	* string/bits/string2.h (__strsep): Remove define.
	(__strsep_1c): Remove.
	(__strsep_2c): Remove.
	(__strsep_3c): Remove.
	(strsep): Remove.
	* sysdeps/unix/sysv/linux/internal_statvfs.c
	(__statvfs_getflags): Rename to __strsep.
2016-12-21 15:16:29 +00:00
..
aarch64 Refactor long double information into bits/long-double.h. 2016-12-14 18:27:56 +00:00
alpha Refactor long double information into bits/long-double.h. 2016-12-14 18:27:56 +00:00
arm New string function explicit_bzero (from OpenBSD). 2016-12-16 16:21:54 -05:00
generic Remove unused function _dl_tls_setup 2016-12-21 14:30:56 +01:00
gnu Define wordsize.h macros everywhere 2016-11-04 09:37:44 -07:00
hppa Add missing hidden_def (__sigsetjmp). 2016-12-01 20:49:25 +00:00
i386 Fix x86, x86_64 fmax, fmin sNaN handling, add tests (bug 20947). 2016-12-15 23:52:18 +00:00
ia64 Refactor long double information into bits/long-double.h. 2016-12-14 18:27:56 +00:00
ieee754 Add roundeven, roundevenf, roundevenl. 2016-12-21 01:48:27 +00:00
init_array Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
m68k Refactor long double information into bits/long-double.h. 2016-12-14 18:27:56 +00:00
mach Fix hurd __access_noerrno implementation. 2016-11-18 16:49:08 -02:00
microblaze Remove cached PID/TID in clone 2016-11-24 19:38:51 -02:00
mips Refactor long double information into bits/long-double.h. 2016-12-14 18:27:56 +00:00
nacl Add roundeven, roundevenf, roundevenl. 2016-12-21 01:48:27 +00:00
nios2 Remove cached PID/TID in clone 2016-11-24 19:38:51 -02:00
nptl Remove cached PID/TID in clone 2016-11-24 19:38:51 -02:00
posix hurd: fix fcntl visibility 2016-09-18 23:48:55 +02:00
powerpc Fix powerpc64/power7 memchr for large input sizes 2016-12-16 11:30:20 -02:00
pthread Installed-header hygiene (BZ#20366): time.h types. 2016-09-23 08:43:56 -04:00
s390 Refactor long double information into bits/long-double.h. 2016-12-14 18:27:56 +00:00
sh Add missing hidden_def (__sigsetjmp). 2016-12-01 20:49:25 +00:00
sparc Refactor long double information into bits/long-double.h. 2016-12-14 18:27:56 +00:00
tile Add missing hidden_def (__sigsetjmp). 2016-12-01 20:49:25 +00:00
unix This patch cleans up the strsep implementation and improves performance. 2016-12-21 15:16:29 +00:00
wordsize-32 Define wordsize.h macros everywhere 2016-11-04 09:37:44 -07:00
wordsize-64 Define wordsize.h macros everywhere 2016-11-04 09:37:44 -07:00
x86 Disable TSX on some Haswell processors. 2016-12-19 14:15:57 +03:00
x86_64 x86_64: tst-quad1pie, tst-quad2pie: compile with -fPIE [BZ #7065] 2016-12-21 12:04:12 +01:00