summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>1999-11-05 07:59:40 +0000
committerJim Meyering <jim@meyering.net>1999-11-05 07:59:40 +0000
commit2d81adfab6aa81d846effbeba35859f6df9faf4e (patch)
treee38addc0698f65276a8e350e0cffeac25f4d117b /src
parentac0c37fd788930d32f69015a5c6c272d1a084d59 (diff)
downloadcoreutils-2d81adfab6aa81d846effbeba35859f6df9faf4e.tar.xz
(SORTALLOC): New macro.
(sortalloc, mergealloc, LINEALLOC): Use it. (sortalloc, mergealloc, linelength): Now const. (sortalloc): Increase from 0.5 to 8 MB. (mergealloc): Increase from 16 to 256 kB. (LINEALLOC): Increase from 0.25 to 4 MB.
Diffstat (limited to 'src')
-rw-r--r--src/sort.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/sort.c b/src/sort.c
index c76bc0510..4bfa853c2 100644
--- a/src/sort.c
+++ b/src/sort.c
@@ -202,19 +202,20 @@ static MONTHTAB_CONST struct month monthtab[] =
/* During the merge phase, the number of files to merge at once. */
#define NMERGE 16
-/* Initial buffer size for in core sorting. Will not grow unless a
- line longer than this is seen. */
-static int sortalloc = 512 * 1024;
+/* Initial buffer size for in-core sorting. The buffer will grow only
+ if a line longer than this is seen. */
+#define SORTALLOC (8 * 1024 * 1024)
+static int const sortalloc = SORTALLOC;
/* Initial buffer size for in core merge buffers. Bear in mind that
up to NMERGE * mergealloc bytes may be allocated for merge buffers. */
-static int mergealloc = 16 * 1024;
+static int const mergealloc = SORTALLOC / NMERGE / 2;
/* Guess of average line length. */
-static int linelength = 30;
+static int const linelength = 30;
/* Maximum number of elements for the array(s) of struct line's, in bytes. */
-#define LINEALLOC (256 * 1024)
+#define LINEALLOC (SORTALLOC / 2)
/* Directory in which any temporary files are to be created. */
static char *temp_dir;