From 5a9883d27c018256c45e450764cf711fe53ce0f3 Mon Sep 17 00:00:00 2001 From: Andrew Gallant Date: Wed, 21 Sep 2016 20:47:40 -0400 Subject: Try to use memory maps more aggressively on Windows. Some brief playing around suggests that it is faster. However, it's probably slower in a VM. Let's prioritize native users. --- src/args.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/args.rs b/src/args.rs index 63080703..77210a8f 100644 --- a/src/args.rs +++ b/src/args.rs @@ -131,7 +131,7 @@ Less common options: --mmap Search using memory maps when possible. This is enabled by default when ripgrep thinks it will be faster. (Note that mmap searching - doesn't current support the various context related options.) + doesn't currently support the various context related options.) --no-mmap Never use memory maps, even when they might be faster. @@ -273,6 +273,9 @@ impl RawArgs { false } else if self.flag_mmap { true + } else if cfg!(windows) { + // On Windows, memory maps appear faster than read calls. Neat. + true } else { // If we're only searching a few paths and all of them are // files, then memory maps are probably faster. -- cgit v1.2.3