Mercurial > lbo > hg > localmr
changeset 96:f9e57345d7aa
Use buffered reads.
author | Lewin Bormann <lbo@spheniscida.de> |
---|---|
date | Sun, 07 Feb 2016 19:01:53 +0000 |
parents | c00c0af1efd2 |
children | 87a7d4ea9519 |
files | src/formats/writelog.rs |
diffstat | 1 files changed, 2 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/src/formats/writelog.rs Sun Feb 07 18:50:49 2016 +0000 +++ b/src/formats/writelog.rs Sun Feb 07 19:01:53 2016 +0000 @@ -153,7 +153,7 @@ fs::OpenOptions::new() .read(true) .open(file) - .map(move |f| WriteLogReader::new(Box::new(f))) + .map(move |f| WriteLogReader::new(Box::new(io::BufReader::with_capacity(1024 * 1024, f)))) } /// Opens all files from a directory which end in suffix, and chains them together. @@ -176,7 +176,7 @@ println!("Error opening {:?}: {}", name, e); continue; } - Ok(f) => reader = Box::new(reader.chain(f)), + Ok(f) => reader = Box::new(reader.chain(io::BufReader::with_capacity(1024 * 1024, f))), } } }