Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 17 Jun 2021 17:53:43 GMT
From:      Mark Johnston <markj@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: 68d3790ba0bc - main - sort: Change default algorithm to mergesort
Message-ID:  <202106171753.15HHrhec049679@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by markj:

URL: https://cgit.FreeBSD.org/src/commit/?id=68d3790ba0bce162f9fcaed09cfecd9adeab3943

commit 68d3790ba0bce162f9fcaed09cfecd9adeab3943
Author:     Cyril Zhang <cyril@freebsdfoundation.org>
AuthorDate: 2021-06-17 17:40:16 +0000
Commit:     Mark Johnston <markj@FreeBSD.org>
CommitDate: 2021-06-17 17:53:03 +0000

    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
---
 usr.bin/sort/file.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/usr.bin/sort/file.h b/usr.bin/sort/file.h
index 724928a7c050..70b46fecaca1 100644
--- a/usr.bin/sort/file.h
+++ b/usr.bin/sort/file.h
@@ -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.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202106171753.15HHrhec049679>