uutils / uutils/coreutils

cat: GNU has better throughput without splice() code path

Open
#11,801 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

U - cat
Dominant language
Rust
Stars
24.1k
Forks
2k
Avg merge
1d 5h
Merged PRs (30d)
365

Description

$ truncate -s 9PB /tmp/huge
$ strace -o /dev/null -e inject=splice:error=ENOSYS cat /tmp/huge | pv>/dev/null
^C08GiB 0:00:02 [ 521MiB/s]
$ strace -o /dev/null -e inject=splice:error=ENOSYS gnu-9a3479f1e/cat /tmp/huge | pv>/dev/null
^C72GiB 0:00:01 [1.72GiB/s] 

This is important on non-Linux platforms. Actually, I missed that pipe size is 1 MiB on Linux.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the two throughput comparisons in the issue using the 9PB sparse file, strace, and pv. Then locate the cat implementation and its splice() code path, comparing behavior when splice() is unavailable. Done should include an evidence-based resolution of the throughput difference, with relevant tests or benchmarks if the project provides them.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
cli, operating-systems, performance
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.