sort: Change default algorithm to mergesort

This results in a significant improvement in the runtime of sort(1) when
radix sort cannot be used.  This comes at the expense of increased
memory usage, but this is small relative to sort's overall memory usage.

PR:		255551
Reviewed by:	markj
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D30319
This commit is contained in:
Cyril Zhang 2021-06-17 13:40:16 -04:00 committed by Mark Johnston
parent a877965fa3
commit 68d3790ba0

View file

@ -41,8 +41,8 @@
#define SORT_HEAPSORT 3
#define SORT_RADIXSORT 4
#define DEFAULT_SORT_ALGORITHM SORT_HEAPSORT
#define DEFAULT_SORT_FUNC heapsort
#define DEFAULT_SORT_ALGORITHM SORT_MERGESORT
#define DEFAULT_SORT_FUNC mergesort
/*
* List of data to be sorted.