Skip to content

cat: unnecessary +1 splice() call with small input #11847

Description

@oech3

separated issue from #10832 .

$ head -c 4096 /dev/zero >/tmp/huge
$ strace -c -e splice cat /tmp/huge >/dev/null
% time     seconds  usecs/call     calls    errors syscall
------ ----------- ----------- --------- --------- ----------------
100.00    0.000007           1         4         1 splice

But we should have 3 splice() as

  1. try to splice() without broker pipe (FAIL)
  2. splice() to broker pipe
  3. splice() to output from broker

related: #11844 (comment)

Activity

  1. oech3 commented on Apr 16, 2026

    @oech3
    ContributorAuthor

    Oh... we cannot use stat due to FUSE issue...
    So this is low-priority task. (clap has more overhead)

  2. oech3 commented on Apr 16, 2026

    @oech3
    ContributorAuthor

    We have 2 if 1st splice succeed while GNU always have 3 splice()s with 65536 byte input. We can do same things with GNU. But I think trying to save pipe is useful for throughput. Closing.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions