Skip to content

yes: strange performance gap between yes vs yes no (3 bytes is much faster than 2 bytes) #12632

@oech3

Description

@oech3

yes has multiple of 2 bytes output (y\newline, tee() only code path)
while yes no has multiple of 3 bytes (tee() + splice() code path).
This happens only with main branch's pv.

$ yes y | pv>/dev/null
35.5GiB 0:00:01 [35.5GiB/s]
$ yes no | pv>/dev/null
56.3GiB 0:00:01 [56.3GiB/s]

Logically, tee() only should have hald syscalls/sec and should be slightly faster.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions