cosmopolitan/test/libc
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
..
bits Fold LIBC_BITS into LIBC_INTRIN 2022-08-11 12:13:18 -07:00
calls Make more compatibility improvements 2022-09-06 07:04:13 -07:00
dns Fold LIBC_RAND into LIBC_STDIO/TINYMATH/INTRIN 2022-08-11 12:32:00 -07:00
fmt Remove testonly keyword 2022-09-05 08:41:43 -07:00
intrin Make pthread mutexes more scalable 2022-09-05 15:57:51 -07:00
log Clean up some code 2022-08-20 12:32:51 -07:00
mem Remove testonly keyword 2022-09-05 08:41:43 -07:00
nexgen32e Do some string library work 2022-08-20 22:17:14 -07:00
release Remove warnings from amalgamation header 2022-08-18 18:16:53 -07:00
runtime Remove accidental comment 2022-09-04 00:41:09 -07:00
sock Fix inet_ntop(AF_INET6) buffer length (#582) 2022-09-03 22:46:45 -07:00
stdio Improve zipos path handling (#579) 2022-09-03 22:50:23 -07:00
str Use a better sorting algorithm 2022-09-06 11:06:10 -07:00
thread Implement POSIX threads API 2022-09-05 08:27:15 -07:00
time Remove testonly keyword 2022-09-05 08:41:43 -07:00
tinymath Add automatic TMPDIR setup/teardown to GNU Make 2022-08-14 02:03:41 -07:00
x Do some string library work 2022-08-20 22:17:14 -07:00
xed Remove testonly keyword 2022-09-05 08:41:43 -07:00
test.mk Fold LIBC_UNICODE into LIBC_STR 2022-08-13 08:42:32 -07:00