summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorBo Borgerson <gigabo@gmail.com>2008-04-05 13:33:51 -0400
committerJim Meyering <meyering@redhat.com>2008-06-17 22:36:51 +0200
commit20905b0cdcb960c9949763c606f15e7e09d02e00 (patch)
tree4857729dfcb9dfa816027a106567c166e8260271 /doc
parent322c6f2e5cd3d09ed31d9d8dea2310d70f47842a (diff)
downloadcoreutils-20905b0cdcb960c9949763c606f15e7e09d02e00.tar.xz
sort: accept new option --batch-size=NMERGE
* src/sort.c: (static unsigned int nmerge) Replace constant NMERGE. (specify_nmerge) Validate and apply new option. (mergefps) Replace some arrays with pointers to xnmalloc'd storage. * tests/misc/sort-merge: Test new option. * doc/coreutils.texi: Describe new option. * NEWS: Advertise new option.
Diffstat (limited to 'doc')
-rw-r--r--doc/coreutils.texi23
1 files changed, 23 insertions, 0 deletions
diff --git a/doc/coreutils.texi b/doc/coreutils.texi
index e4a979e61..f7b9e7844 100644
--- a/doc/coreutils.texi
+++ b/doc/coreutils.texi
@@ -3804,6 +3804,29 @@ multiple fields.
Example: To sort on the second field, use @option{--key=2,2}
(@option{-k 2,2}). See below for more examples.
+@item --batch-size=@var{nmerge}
+@opindex --batch-size
+@cindex number of inputs to merge, nmerge
+Merge at most @var{nmerge} inputs at once.
+
+When @command{sort} has to merge more than @var{nmerge} inputs,
+it merges them in groups of @var{nmerge}, saving the result in
+a temporary file, which is then used as an input in a subsequent merge.
+
+A large value of @var{nmerge} may improve merge performance and decrease
+temporary storage utilization at the expense of increased memory usage
+and I/0. Conversely a small value of @var{nmerge} may reduce memory
+requirements and I/0 at the expense of temporary storage consumption and
+merge performance.
+
+The value of @var{nmerge} must be at least 2.
+
+The value of @var{nmerge} may be bounded by a resource limit for open
+file descriptors. Try @samp{ulimit -n} or @samp{getconf OPEN_MAX} to
+to display the limit for a particular system.
+If the value of @var{nmerge} exceeds this limit, then @command{sort} will
+issue a warning to standard error and exit with a nonzero status.
+
@item -o @var{output-file}
@itemx --output=@var{output-file}
@opindex -o