Skip to content

head: splice fast-path for -c#11620

Closed
oech3 wants to merge 1 commit intouutils:mainfrom
oech3:head-splice
Closed

head: splice fast-path for -c#11620
oech3 wants to merge 1 commit intouutils:mainfrom
oech3:head-splice

Conversation

@oech3
Copy link
Copy Markdown
Contributor

@oech3 oech3 commented Apr 3, 2026

Closes #11491 . Needs cat from main for benchmark.

$ truncate -s 1PB huge
$ cat huge | target/debug/head -c 1P|pv>/dev/null
^C.5GiB 0:00:02 [38.7GiB/s]

$ target/release/head -c 200000000000 huge|pv>/dev/null
 186GiB 0:00:05 [37.2GiB/s]

[Edit] Fixes #11777

@oech3 oech3 force-pushed the head-splice branch 3 times, most recently from 475564d to 08d3ce4 Compare April 4, 2026 15:02
@oech3

This comment was marked as outdated.

@oech3 oech3 force-pushed the head-splice branch 4 times, most recently from 7e956c5 to bc7b256 Compare April 6, 2026 13:45
@oech3 oech3 force-pushed the head-splice branch 5 times, most recently from 53deb25 to e9bb763 Compare April 12, 2026 18:01
@github-actions
Copy link
Copy Markdown

GNU testsuite comparison:

GNU test failed: tests/seq/seq-io-errors. tests/seq/seq-io-errors is passing on 'main'. Maybe you have to rebase?
Skip an intermittent issue tests/rm/isatty (fails in this run but passes in the 'main' branch)
Skip an intermittent issue tests/tty/tty-eof (fails in this run but passes in the 'main' branch)
Note: The gnu test tests/expand/bounded-memory is now being skipped but was previously passing.
Congrats! The gnu test tests/dd/no-allocate is now passing!

@oech3 oech3 force-pushed the head-splice branch 3 times, most recently from 67c360b to faf91b4 Compare April 12, 2026 18:21
@github-actions
Copy link
Copy Markdown

GNU testsuite comparison:

Skip an intermittent issue tests/date/resolution (fails in this run but passes in the 'main' branch)
Skip an intermittent issue tests/tail/tail-n0f (fails in this run but passes in the 'main' branch)
Skip an intermittent issue tests/tty/tty-eof (fails in this run but passes in the 'main' branch)
Skipping an intermittent issue tests/date/date-locale-hour (passes in this run but fails in the 'main' branch)
Congrats! The gnu test tests/dd/no-allocate is now passing!

@oech3 oech3 marked this pull request as ready for review April 12, 2026 18:42
@oech3 oech3 force-pushed the head-splice branch 3 times, most recently from c0ea499 to 1c435d1 Compare April 13, 2026 12:22
@oech3
Copy link
Copy Markdown
Contributor Author

oech3 commented Apr 13, 2026

Summary
  head-c-splice -c 8192 /etc/pacman.conf ran
    1.03 ± 0.23 times faster than target/release/head -c 8192 /etc/pacman.conf

I was surprised that this is useful even for just 2 pages.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

head -c is incorrect with FUSE fs with fake stat head: splice fast-path for -c

1 participant