3 ms·
Replace `write(..)` with `puts("y")` and you'll be an order of magnitude faster. This is due to `puts` (`printf` too) being buffered (data isn't written to term
by forgotpwd16 1y ago
Replace `write(..)` with `puts("y")` and you'll be an order of magnitude faster. This is due to `puts` (`printf` too) being buffered (data isn't written to term/file immediately but retained in memory until some point). Improving this process (as seen in the reddit thread) gets GNU-yes.
- deleted 1y ago[deleted]
- GoblinSlayer 1y agoIt's line buffered when it prints to terminal.
- jesprenj 1y agoOne rarely needs yes' output to be a terminal.
- throwawaymaths 1y agoDon't you actively want it to flush asap since you're usually piping into another program? I suspect what you suggest creates a more voluminous dump but is slower in the desired use case