From 893ab7c761dd51f298e01c755b0bd678da595481 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dawid=20Ci=C4=99=C5=BCarkiewicz?= Date: Wed, 19 Mar 2014 09:48:05 -0700 Subject: [PATCH] Increase buffers for boost in performance. (cherry picked from commit 4b702bc9522503b88d9084de2ce5780f75ee9e23) --- cat/cat.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cat/cat.rs b/cat/cat.rs index 1cb42c35d..fbba1d622 100644 --- a/cat/cat.rs +++ b/cat/cat.rs @@ -110,7 +110,7 @@ pub fn exec(files: ~[~str], number: NumberingMode, show_nonprint: bool, show_end let mut writer = BufferedWriter::with_capacity(1024 * 8, stdout_raw()); let mut at_line_start = true; - let mut buf = [0, .. 2]; + let mut buf = ~[0, .. 1024 * 4]; loop { // reading from a TTY seems to raise a condition on // EOF, rather than return Some(0) like a file. @@ -170,8 +170,8 @@ pub fn exec(files: ~[~str], number: NumberingMode, show_nonprint: bool, show_end return; } - let mut buf = [0, .. 100000]; let mut writer = stdout_raw(); + let mut buf = ~[0, .. 1024 * 64]; // passthru mode for path in files.iter() { let mut reader = match open(path.to_owned()) {