We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 13ef3e8 commit 2f7f16aCopy full SHA for 2f7f16a
src/uu/cat/src/cat.rs
@@ -489,6 +489,10 @@ fn write_fast<R: FdReadable>(handle: &mut InputHandle<R>) -> CatResult<()> {
489
// If we're not on Linux or Android, or the splice() call failed,
490
// fall back on slower writing.
491
let mut stdout_lock = stdout.lock();
492
+ // stack allocaltion is overhead when splice succeed
493
+ #[cfg(any(target_os = "linux", target_os = "android"))]
494
+ let mut buf = vec![0; 1024 * 64];
495
+ #[cfg(not(any(target_os = "linux", target_os = "android")))]
496
let mut buf = [0; 1024 * 64];
497
loop {
498
match handle.reader.read(&mut buf) {
0 commit comments