From 4941604362856dd449b3189ed01a2bf65800e779 Mon Sep 17 00:00:00 2001 From: Alex Lyon Date: Thu, 22 Mar 2018 03:31:41 -0700 Subject: [PATCH] yes: use 16 KiB rather than 8 KiB for the buffer --- Cargo.lock | 3 +++ src/yes/yes.rs | 4 +++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/Cargo.lock b/Cargo.lock index 512e39651..e5d0b4285 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -791,6 +791,8 @@ version = "0.0.1" dependencies = [ "getopts 0.2.17 (registry+https://github.com/rust-lang/crates.io-index)", "nix 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)", + "redox_syscall 0.1.37 (registry+https://github.com/rust-lang/crates.io-index)", + "redox_termios 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "uucore 0.0.1", ] @@ -1430,6 +1432,7 @@ dependencies = [ "getopts 0.2.17 (registry+https://github.com/rust-lang/crates.io-index)", "kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.39 (registry+https://github.com/rust-lang/crates.io-index)", + "redox_syscall 0.1.37 (registry+https://github.com/rust-lang/crates.io-index)", "uucore 0.0.1", "winapi 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", ] diff --git a/src/yes/yes.rs b/src/yes/yes.rs index 35398ffa8..797511cce 100644 --- a/src/yes/yes.rs +++ b/src/yes/yes.rs @@ -23,7 +23,9 @@ use std::io::{self, Write}; // force a re-build whenever Cargo.toml changes const _CARGO_TOML: &'static str = include_str!("Cargo.toml"); -const BUF_SIZE: usize = 8192; +// it's possible that using a smaller or larger buffer might provide better performance on some +// systems, but honestly this is good enough +const BUF_SIZE: usize = 16 * 1024; pub fn uumain(args: Vec) -> i32 { let app = app_from_crate!().arg(Arg::with_name("STRING").index(1).multiple(true));