diff --git a/c/cli/mlrcli.c b/c/cli/mlrcli.c index f70d1390a..7dc38dfcf 100644 --- a/c/cli/mlrcli.c +++ b/c/cli/mlrcli.c @@ -261,7 +261,7 @@ cli_opts_t* parse_command_line(int argc, char** argv, sllv_t** ppmapper_list) { slls_append(popts->filenames, argv[argi], NO_FREE); } - // Check for use of mmap. It's fractionally faster than stdio (due to fewer data copies + // Check for use of mmap. It's about 20% faster than stdio (due to fewer data copies // -- lrecs can be pointer-backed by mmap memory) but we can't use it in all situations. if (no_input) { slls_free(popts->filenames); @@ -269,6 +269,10 @@ cli_opts_t* parse_command_line(int argc, char** argv, sllv_t** ppmapper_list) { } else if (popts->filenames->length == 0) { // No filenames means read from standard input, and standard input cannot be mmapped. popts->reader_opts.use_mmap_for_read = FALSE; + } else if (popts->filenames->length > 10) { + // https://github.com/johnkerl/miller/issues/256: too many small files is as bad as one big one + // (for which see immediately below). + popts->reader_opts.use_mmap_for_read = FALSE; } else if (popts->reader_opts.use_mmap_for_read == TRUE) { // https://github.com/johnkerl/miller/issues/160: don't use mmap for large files. // diff --git a/doc/manpage.html b/doc/manpage.html index f5cbaca55..176daed80 100644 --- a/doc/manpage.html +++ b/doc/manpage.html @@ -2464,7 +2464,7 @@ SEE ALSO - 2019-06-04 MILLER(1) + 2019-08-24 MILLER(1)

diff --git a/doc/manpage.txt b/doc/manpage.txt index d0b0065bd..498006063 100644 --- a/doc/manpage.txt +++ b/doc/manpage.txt @@ -2270,4 +2270,4 @@ SEE ALSO - 2019-06-04 MILLER(1) + 2019-08-24 MILLER(1) diff --git a/doc/mlr.1 b/doc/mlr.1 index 2fd8f6b4b..0dc55659c 100644 --- a/doc/mlr.1 +++ b/doc/mlr.1 @@ -2,12 +2,12 @@ .\" Title: mlr .\" Author: [see the "AUTHOR" section] .\" Generator: ./mkman.rb -.\" Date: 2019-06-04 +.\" Date: 2019-08-24 .\" Manual: \ \& .\" Source: \ \& .\" Language: English .\" -.TH "MILLER" "1" "2019-06-04" "\ \&" "\ \&" +.TH "MILLER" "1" "2019-08-24" "\ \&" "\ \&" .\" ----------------------------------------------------------------- .\" * Portability definitions .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~