mirror of
https://github.com/uutils/coreutils
synced 2024-11-05 14:21:32 +00:00
cat: Use larger splice size
This raises performance by 10-20% or so.
This commit is contained in:
parent
d002810a47
commit
23647be07a
1 changed files with 2 additions and 1 deletions
|
@ -5,6 +5,7 @@ use std::os::unix::io::{AsRawFd, RawFd};
|
|||
|
||||
use uucore::pipes::{pipe, splice, splice_exact};
|
||||
|
||||
const SPLICE_SIZE: usize = 1024 * 128;
|
||||
const BUF_SIZE: usize = 1024 * 16;
|
||||
|
||||
/// This function is called from `write_fast()` on Linux and Android. The
|
||||
|
@ -22,7 +23,7 @@ pub(super) fn write_fast_using_splice<R: FdReadable>(
|
|||
let (pipe_rd, pipe_wr) = pipe()?;
|
||||
|
||||
loop {
|
||||
match splice(&handle.reader, &pipe_wr, BUF_SIZE) {
|
||||
match splice(&handle.reader, &pipe_wr, SPLICE_SIZE) {
|
||||
Ok(n) => {
|
||||
if n == 0 {
|
||||
return Ok(false);
|
||||
|
|
Loading…
Reference in a new issue