libc: Use musl's optimized strchr, strchrnul, strcspn
Parentheses added to HASZERO macro to avoid a GCC warning.
Obtained from: musl (snapshot at commit c648cefb)
Sponsored by: The FreeBSD Foundation
Differential D17630
libc: Use musl's optimized strchr, strchrnul, strcspn emaste on Oct 20 2018, 10:26 PM. Authored by Tags None Referenced Files
Details libc: Use musl's optimized strchr, strchrnul, strcspn Parentheses added to HASZERO macro to avoid a GCC warning. Obtained from: musl (snapshot at commit c648cefb)
Diff Detail
Event TimelineComment Actions Is this waiting on anything specific? By this point I woud only check for updates and get this in. Comment Actions Looking over some old WIP I had strcspn in this review originally but did not commit it. Some benchmarking shows it's slower than existing libc for some cases I tried, so we can drop it. (Adding this comment for posterity.) this is a strcspn(buf, " \t\n") where the match occurs after 64K: x libc + musl +------------------------------------------------------------------------------+ | x x + | | xx x + | | xx x + + | | xx x + + | | xx x + + | | xxxxx + + + | | xxxxxx + + + | | xxxxxx +++ + | | xxxxxx +++ + | | xxxxxx +++++ | | xxxxxx x + ++++++++ | | xxxxxxx xx + ++++++++ + | | xxxxxxx x xx + ++++++++ + | | x x xxxxxxx x xx x x + + + +++++++++ + | | x x xxxxxxxxx xx x x + + + +++++++++++ + | | x xxxxxxxxxxxxxxxxx x + +++++++ ++++++++++++ + | | xx xxxxxxxxxxxxxxxxx x x x +++++++++ +++++++++++++++++ + + | | xx xxxxxxxxxxxxxxxxxxx xxxx ++++++++++++++++++++++++++++++ + | |xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx +++*+++++*+++++++++++++++++++++++ + + +| | |____M_A_____| |_______A______| | +------------------------------------------------------------------------------+ N Min Max Median Avg Stddev x 200 32752 46293 36478 36916.985 2172.4189 + 200 43362 58179 48444 48463.315 2587.0197 Difference at 95.0% confidence 11546.3 +/- 468.191 31.2765% +/- 1.44552% (Student's t, pooled s = 2388.73) |