cosmopolitan/test/libc/str
Justine Tunney 11ec60d5fc
Use a better sorting algorithm
This change changes qsort() to use the same code as NetBSD and MacOS
because it goes 6x faster than Musl's SmoothSort function. Smoothsort
can still be used if you need something that's provenly linearithmic.
This change also improves GNU Make performance on whole by 7 percent!

netbsd nearly   l:    70,196c    22,673ns   m:    68,428c    22,102ns
musl nearly     l:    53,844c    17,391ns   m:    58,726c    18,968ns
unixv6 nearly   l:    65,885c    21,280ns   m:    63,082c    20,375ns

netbsd reverse  l:   120,290c    38,853ns   m:   122,619c    39,605ns
musl reverse    l:   801,826c   258,985ns   m:   794,689c   256,680ns
unixv6 reverse  l:    58,977c    19,049ns   m:    59,764c    19,303ns

netbsd random   l:   146,745c    47,398ns   m:   145,782c    47,087ns
musl random     l:   855,804c   276,420ns   m:   850,912c   274,840ns
unixv6 random   l:   214,325c    69,226ns   m:   213,906c    69,090ns

netbsd 2n       l:    77,299c    24,967ns   m:    76,773c    24,797ns
musl 2n         l:   818,012c   264,213ns   m:   818,282c   264,301ns
unixv6 2n       l: 3,967,009c 1,281,322ns   m: 3,941,792c 1,273,177ns

https://justine.lol/dox/sort.pdf
2022-09-06 11:06:10 -07:00
..
a64l_test.c Implement better hypot function 2021-02-21 11:06:18 -08:00
blake2_test.c Fold LIBC_RAND into LIBC_STDIO/TINYMATH/INTRIN 2022-08-11 12:32:00 -07:00
blake2b256_tests.txt Decentralize Python native module linkage 2021-09-07 11:40:11 -07:00
bsr_test.c Change license 2020-12-27 17:18:44 -08:00
bzero_test.c Fold LIBC_RAND into LIBC_STDIO/TINYMATH/INTRIN 2022-08-11 12:32:00 -07:00
classifypath_test.c Add NET_HTTP to the amalgamation 2022-05-16 14:47:49 -07:00
crc32c_test.c Fold LIBC_BITS into LIBC_INTRIN 2022-08-11 12:13:18 -07:00
crc32z_test.c Fold LIBC_BITS into LIBC_INTRIN 2022-08-11 12:13:18 -07:00
highwayhash64_test.c Fold LIBC_RAND into LIBC_STDIO/TINYMATH/INTRIN 2022-08-11 12:32:00 -07:00
isutf8_test.c Unbloat the build 2022-08-11 00:15:29 -07:00
longsort_test.c Fold LIBC_ALG into LIBC_MEM 2022-08-13 08:32:34 -07:00
memcasecmp_test.c Add SNI support to redbean and improve SSL perf 2021-07-23 13:56:13 -07:00
memccpy_test.c Fold LIBC_RAND into LIBC_STDIO/TINYMATH/INTRIN 2022-08-11 12:32:00 -07:00
memcpy_test.c Fold LIBC_RAND into LIBC_STDIO/TINYMATH/INTRIN 2022-08-11 12:32:00 -07:00
memfrob_test.c Fold LIBC_BITS into LIBC_INTRIN 2022-08-11 12:13:18 -07:00
memmem_test.c Fold LIBC_ALG into LIBC_MEM 2022-08-13 08:32:34 -07:00
memmove_test.c Improve Libc by making Python work even better 2021-08-18 22:16:23 -07:00
memrchr16_test.c Perform some code cleanup 2022-06-23 10:21:07 -07:00
memrchr_test.c Fold LIBC_RAND into LIBC_STDIO/TINYMATH/INTRIN 2022-08-11 12:32:00 -07:00
qsort_r_test.c Use a better sorting algorithm 2022-09-06 11:06:10 -07:00
regex_test.c Reduce makefile dependencies by 10% 2022-06-08 20:01:28 -07:00
setlocale_test.c Add fake support for locale="" (#546) 2022-08-18 15:51:23 -07:00
sigset_test.c Fold LIBC_BITS into LIBC_INTRIN 2022-08-11 12:13:18 -07:00
str_test.c Fold LIBC_BITS into LIBC_INTRIN 2022-08-11 12:13:18 -07:00
strcasecmp_test.c Get more Python tests passing (#141) 2021-08-16 15:26:31 -07:00
strcasestr_test.c Fold LIBC_ALG into LIBC_MEM 2022-08-13 08:32:34 -07:00
strcat_test.c Get more Python tests passing (#141) 2021-08-16 15:26:31 -07:00
strchr_test.c Do some string library work 2022-08-20 22:17:14 -07:00
strclen_test.c Improve Python and Linenoise 2021-09-11 22:30:37 -07:00
strcmp_test.c Remove testonly keyword 2022-09-05 08:41:43 -07:00
strcpy_test.c Change license 2020-12-27 17:18:44 -08:00
strlcpy_test.c Fix strtol 2020-12-29 22:40:52 -08:00
strnlen_test.c Perform some code cleanup 2022-06-23 10:21:07 -07:00
strnwidth_test.c Make more compatibility improvements 2022-09-06 07:04:13 -07:00
strpbrk_test.c Make fixes, improvements, and chibicc python bindings 2021-10-08 08:41:57 -07:00
strrchr_test.c Improve backwards compatibility with GNU Make 2021-05-02 07:48:59 -07:00
strstr_test.c Fold LIBC_ALG into LIBC_MEM 2022-08-13 08:32:34 -07:00
strtok_r_test.c Make C memory safe like Rust 2021-02-01 03:58:46 -08:00
strtolower_test.c Fold LIBC_BITS into LIBC_INTRIN 2022-08-11 12:13:18 -07:00
test.mk Fold LIBC_UNICODE into LIBC_STR 2022-08-13 08:42:32 -07:00
towupper_test.c Improve Python and Linenoise 2021-09-11 22:30:37 -07:00
tpenc_test.c Fold LIBC_RAND into LIBC_STDIO/TINYMATH/INTRIN 2022-08-11 12:32:00 -07:00
tprecode8to16_test.c Fold LIBC_BITS into LIBC_INTRIN 2022-08-11 12:13:18 -07:00
tprecode16to8_test.c Make C memory safe like Rust 2021-02-01 03:58:46 -08:00
undeflate_test.c Clean up some code 2022-08-20 12:32:51 -07:00
wcsrchr_test.c Get more Python tests passing (#141) 2021-08-16 15:26:31 -07:00
wcwidth_test.c Make more compatibility improvements 2022-09-06 07:04:13 -07:00
wmemrchr_test.c Add more missing C / C++ headers 2022-09-04 04:53:52 -07:00